Skip to content

Commit a0749f6

Browse files
authored
fix creating debugging comment for HTML comment (#4567)
1 parent e247de3 commit a0749f6

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Svelte changelog
22

3+
## Unreleased
4+
5+
* Fix attaching of JS debugging comments to HTML comments ([#4565](https://github.com/sveltejs/svelte/issues/4565))
6+
37
## 3.20.1
48

59
* Fix compiler regression with slots ([#4562](https://github.com/sveltejs/svelte/issues/4562))

src/compiler/compile/render_dom/wrappers/shared/create_debugging_comment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function create_debugging_comment(
2424
while (source[d] !== '>') d += 1;
2525
d += 1;
2626
}
27-
} else if (node.type === 'Text') {
27+
} else if (node.type === 'Text' || node.type === 'Comment') {
2828
d = node.end;
2929
} else {
3030
// @ts-ignore
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<slot name="a"><!-- placeholder--></slot>
2+
<slot name="b"><!-- placeholder--> </slot>
3+
<slot name="c"><!-- placeholder--> foobar </slot>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
html: `
3+
foobar
4+
`,
5+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script>
2+
import Inner from "./Inner.svelte";
3+
</script>
4+
5+
<Inner></Inner>

0 commit comments

Comments
 (0)