Skip to content

Drop contents of style, script, and metadata tags#16

Open
gschlager wants to merge 1 commit intomainfrom
drop-style-script-tag-contents
Open

Drop contents of style, script, and metadata tags#16
gschlager wants to merge 1 commit intomainfrom
drop-style-script-tag-contents

Conversation

@gschlager
Copy link
Copy Markdown
Member

@gschlager gschlager commented Apr 22, 2026

  • The HTML parser's unknown-tag fallback strips the wrapper but still descends into children, which emitted CSS inside <style> (and would do the same for <script> bodies) as text in the output.
  • Adds an IGNORED_TAGS set checked before the unknown-tag fallback so style/script/head/title/noscript/template subtrees are skipped entirely.

The HTML parser's unknown-tag fallback strips the wrapper but still
descends into children, which emitted the CSS inside <style> (and would
do the same for <script> bodies) as text in the output.

Add an IGNORED_TAGS set checked before the unknown-tag fallback so
style/script/head/title/noscript/template subtrees are skipped entirely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant