Skip to content
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

Fix style / script parsing #1445

Open
exyi opened this issue Aug 5, 2022 · 0 comments · May be fixed by #1900
Open

Fix style / script parsing #1445

exyi opened this issue Aug 5, 2022 · 0 comments · May be fixed by #1900
Milestone

Comments

@exyi
Copy link
Member

exyi commented Aug 5, 2022

style and script tags have special treatment in HTML - they contain verbatim text, not any nested elements. We should parse the contents as an unencoded text, simply looking for end: <script\b (case insensitive).

We need to do this in a major version, since it's a breaking change (for example, someone may rely on {{resource:X}} working in script).

We should consider giving the same parsing exception to dot:InlineScript

@exyi exyi added this to the Version 5.0 milestone Aug 5, 2022
exyi added a commit that referenced this issue Dec 28, 2024
In HTML, the content of <script> and <style> tags should not be parsed as HTML,
the parser should simply look for the end tag.
This eliminates the need to HTML-encode all `<` operators (or even
HTML inlined in string literals).

To align dothtml and HTML, the patch implements this behavior in dothtml.
The change may easily break someone's code, if they already have
a script element with entities like &lt;, so it is possible to configure
which tags will be parsed as "raw text".
By default, it is script, style and also dot:InlineScript and
dot:HtmlLiteral (as suggested in #1428). This setting is up for debate.

resolves #1445
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant