Skip to content

Issues with new entity escaping behavior #1082

@Conduitry

Description

@Conduitry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions