-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with new entity escaping behavior #1082
Comments
Also, relatedly, I think the new |
[WIP] Fix HTML escaping and non-top-level <script> and <style> issues
Only seems to happen if the characters are inside an element that isn't at the top level: https://svelte.technology/repl?version=1.51.0&gist=637056dfca497eb872db02ca231ef89d |
Waiting until sveltejs/svelte#1082 is fixed
Yeah that issue is one of the ones fixed by my PR, which has been merged and will be in the next version. |
Just released the fix — closing |
fix escaping of sigils in SSR non-top-level <script> and <style>
The new entity escaping in 1.51 introduced a couple of issues:
Compiling
<div>'foo'<bar/></div>
results in code that renders&##39;foo&##39;
. There's obviously something going on with the sigil escaping here. Either it never gets unescaped, or it's getting escaped an additional time before getting unescaped.Non-top-level
<style>
and<script>
elements (which are useful when using SSR to render an entire document) are rendered back into the document with entities escaped, which breaks a bunch of stuff.Also an existing problem from before 1.51: Non-top-level
<style>
and<script>
elements are parsed as though they were HTML. So e.g. something like<div><script>alert('<>')</script></div>
results in a parse error because Svelte is expecting a tag name in the<>
. The parser should consume until the</script>
when inside a<script>
tag, even if it is not a top-level one.The text was updated successfully, but these errors were encountered: