Skip to content

Commit 573d59c

Browse files
committed
fix: detect root snippets correctly
previously snippets inside top level if blocks etc where wrongfully detected as being a root snippet
1 parent e94b82e commit 573d59c

File tree

1 file changed

+1
-1
lines changed
  • packages/svelte2tsx/src/htmlxtojsx_v2

1 file changed

+1
-1
lines changed

packages/svelte2tsx/src/htmlxtojsx_v2/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function convertHtmlxToJsx(
9191
? element
9292
: undefined
9393
);
94-
if (!element) {
94+
if (parent === ast) {
9595
// root snippet -> move to instance script
9696
rootSnippets.push([node.start, node.end]);
9797
}

0 commit comments

Comments
 (0)