Skip to content

Commit

Permalink
fix: detect root snippets correctly
Browse files Browse the repository at this point in the history
previously snippets inside top level if blocks etc where wrongfully detected as being a root snippet
  • Loading branch information
dummdidumm committed Jun 26, 2024
1 parent e94b82e commit 573d59c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/svelte2tsx/src/htmlxtojsx_v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function convertHtmlxToJsx(
? element
: undefined
);
if (!element) {
if (parent === ast) {
// root snippet -> move to instance script
rootSnippets.push([node.start, node.end]);
}
Expand Down

0 comments on commit 573d59c

Please sign in to comment.