Skip to content

Commit 5135b7f

Browse files
authored
Fix wrong AST for empty style tag. (#69)
1 parent 3b34a86 commit 5135b7f

File tree

4 files changed

+875
-1
lines changed

4 files changed

+875
-1
lines changed

src/parser/converts/root.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export function convertSvelteRoot(
109109
},
110110
})
111111

112-
if (style.endTag) {
112+
if (style.endTag && style.startTag.range[1] < style.endTag.range[0]) {
113113
const contentRange = {
114114
start: style.startTag.range[1],
115115
end: style.endTag.range[0],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<style src="./style.scss"></style>
2+
<div></div>
3+
<script></script>

0 commit comments

Comments
 (0)