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(html/codegen): Expand elements before which body isn’t elided #8877

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

andersk
Copy link
Contributor

@andersk andersk commented 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, 13.2.6.4.6 The "after head" insertion mode.

Related issue (if exists):

@andersk andersk requested a review from a team as a code owner April 19, 2024 01:52
Copy link

changeset-bot bot commented Apr 19, 2024

⚠️ No Changeset found

Latest commit: a405b87

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@andersk
Copy link
Contributor Author

andersk commented Apr 19, 2024

(Does this repo actually use changeset? There is no .changeset folder and there don’t seem to be any PRs that add one.)

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>
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swc-bump:

  • swc_html_codegen
  • swc_core

@kdy1 kdy1 added this to the Planned milestone Apr 19, 2024
@kdy1 kdy1 enabled auto-merge (squash) April 19, 2024 12:52
@kdy1 kdy1 merged commit 5419a94 into swc-project:main Apr 19, 2024
147 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.4.17 Apr 23, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

HTML minifier’s elision of <body> next to <noscript> leads to invalid HTML
2 participants