[Bug] Unterminated comment
Afsoon opened this issue · 2 comments
Hello everyone, today while I was written some comments, I discover that the svelte plugin can't parse a comment with a script tag inside of the comment. The error is Unterminated comment even if you the comments closed.
Steps to reproduce
The following codesanbox hast the minimal code https://codesandbox.io/s/intelligent-liskov-yye07?file=/Button.svelte
Workaround
Remove the tags from the script tag inside of the comment
Expected
The rollup plugin ignore the script tag inside the comment
Versions
Svelte: 3.28
Rollup Svelte Plugin: 5.0.3
I don't know if it's intentional this error or no, I couldn't find any place that say isn't allowed to write that.
That's not a Svelte or Rollup issue, that's how parsing script tags works everywhere.
Try opening this html file in your browser to see the same behavior:
<html>
<script>
/*
</script>
*/
</script>
</html>This is a duplicate of sveltejs/svelte#3039 / sveltejs/svelte#3840 / sveltejs/svelte#4406 / sveltejs/svelte#4996 / sveltejs/svelte#5024 / sveltejs/svelte-repl#126 / maybe others, and is not a bug. This is how parsing inline script tags works in HTML.