-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
HTML minifier’s elision of <body>
next to <noscript>
leads to invalid HTML
#8876
Comments
andersk
added a commit
to andersk/swc
that referenced
this issue
Apr 19, 2024
For example, transforming <body><noscript> to <noscript> would incorrectly change the meaning so <noscript> is parsed as a child of <head>. Fixes swc-project#8876. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
andersk
added a commit
to andersk/swc
that referenced
this issue
Apr 19, 2024
For example, transforming <body><noscript> to <noscript> would incorrectly change the meaning so <noscript> is parsed as a child of <head>. Fixes swc-project#8876. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
andersk
added a commit
to andersk/swc
that referenced
this issue
Apr 19, 2024
For example, transforming <body><noscript> to <noscript> would incorrectly change the meaning so <noscript> is parsed as a child of <head>. Fixes swc-project#8876. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
kdy1
pushed a commit
that referenced
this issue
Apr 19, 2024
) **Description:** For example, transforming `<body><noscript>` to `<noscript>` would incorrectly change the meaning so `<noscript>` is parsed as a child of `<head>`. Reference: [§13.2.6.4.4 The "in head" insertion mode](https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inhead), [13.2.6.4.6 The "after head" insertion mode](https://html.spec.whatwg.org/multipage/parsing.html#the-after-head-insertion-mode). **Related issue:** - Closes #8876. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When using
swc_html_minifier
andCodeGenConfig { minify: true, … }
, SWC elides the<body>
tag, which is usually fine. However, when the following tag is<noscript>
, the output is invalid HTML. This also crashes Farm (farm-fe/farm#1210).Input source (valid):
Output source (invalid):
Reproduction code:
The text was updated successfully, but these errors were encountered: