fix creating debugging comment for HTML comment (#4567)

pull/4595/head
Tan Li Hau 5 years ago committed by GitHub
parent e247de351b
commit a0749f6adb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,9 @@
# Svelte changelog
## Unreleased
* Fix attaching of JS debugging comments to HTML comments ([#4565](https://github.com/sveltejs/svelte/issues/4565))
## 3.20.1
* Fix compiler regression with slots ([#4562](https://github.com/sveltejs/svelte/issues/4562))

@ -24,7 +24,7 @@ export default function create_debugging_comment(
while (source[d] !== '>') d += 1;
d += 1;
}
} else if (node.type === 'Text') {
} else if (node.type === 'Text' || node.type === 'Comment') {
d = node.end;
} else {
// @ts-ignore

@ -0,0 +1,3 @@
<slot name="a"><!-- placeholder--></slot>
<slot name="b"><!-- placeholder--> </slot>
<slot name="c"><!-- placeholder--> foobar </slot>

@ -0,0 +1,5 @@
export default {
html: `
foobar
`,
};

@ -0,0 +1,5 @@
<script>
import Inner from "./Inner.svelte";
</script>
<Inner></Inner>
Loading…
Cancel
Save