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

Special-case parsing of <script> and <style> elements, similarly to HTML #1900

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

exyi
Copy link
Member

@exyi exyi commented 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 <, 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

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 this pull request may close these issues.

Fix style / script parsing
1 participant