Skip to content

Commit 8a26918

Browse files
authored
Merge pull request #976 from teleporthq/fix/THQ-4211
fix/THQ-4211 Fix / being omitted in html generation for image src
2 parents 96cac18 + f3e97dc commit 8a26918

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/teleport-plugin-html-base-component/src/node-handlers.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,9 +962,12 @@ const handleAttributes = (
962962
extractDefaultValueFromRefPath(value.defaultValue, content.refPath)
963963
)
964964

965-
if ((elementType === 'img' || elementType === 'video') && attrKey === 'src') {
965+
if (
966+
(elementType === 'img' || elementType === 'video') &&
967+
attrKey === 'src' &&
968+
!extractedValue.startsWith('http')
969+
) {
966970
const path = join(relative(join(...outputOptions.folderPath), './'), extractedValue)
967-
968971
HASTUtils.addAttributeToNode(htmlNode, attrKey, path)
969972
break
970973
}

0 commit comments

Comments
 (0)