Parsing fails when the string is contained anywhere in the script section, even if enclosed in a string or a comment.
Reproduction
Create a new +page.svelte and use that code:
<script lang="ts">
// Case 1:
// </script>
// Case 2:
let text = '</script>';
let a = 1;
</script>
As you will notice, both case in that code prevent the page from compiling. Case 1 should not have any effect because the tag is in comment, and case 2 should not generate an error as the is enclosed in string (that's how I noticed that problem in the first place)
Logs
[plugin:vite-plugin-svelte] /home/REDACTED/REDACTED/REDACTED/REDACTED/src/routes/test/+page.svelte:4:16 </script> attempted to close an element that was not open
/home/REDACTED/REDACTED/REDACTED/REDACTED/src/routes/test/+page.svelte:4:16
2 |
3 | // Case 2:
4 | let text = '</script>';
^
5 | let a = 1;
6 | </script>
Describe the bug
Parsing fails when the string is contained anywhere in the script section, even if enclosed in a string or a comment.
Reproduction
Create a new +page.svelte and use that code:
As you will notice, both case in that code prevent the page from compiling. Case 1 should not have any effect because the tag is in comment, and case 2 should not generate an error as the is enclosed in string (that's how I noticed that problem in the first place)
Logs
System Info
Severity
serious, but I can work around it
Additional Information
No response