fix(html): run the any-other-end-tag fallback for a marker-shielded nobr#21274
Conversation
When the adoption agency algorithm finds no formatting element because a marker (from marquee/object/applet or a table) shields the nobr in the list of active formatting elements, the start tag must act as the any-other-end-tag entry and pop the open nobr. The handler ignored that case, so a second nobr nested inside the first. Also bumps html5lib-tests to cover the new case.
🦋 Changeset detectedLatest commit: d51b303 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
This PR is packaged and the instant preview is available (9a51ee1). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@9a51ee1
yarn add -D webpack@https://pkg.pr.new/webpack@9a51ee1
pnpm add -D webpack@https://pkg.pr.new/webpack@9a51ee1 |
Types CoverageCoverage after merging claude/pr-21271-bug-fix-hzgywg into main will be
Coverage Report |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21274 +/- ##
==========================================
+ Coverage 92.84% 92.86% +0.02%
==========================================
Files 592 592
Lines 65022 65024 +2
Branches 18162 18163 +1
==========================================
+ Hits 60367 60382 +15
+ Misses 4655 4642 -13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
|
Summary
The html5lib-tests bump in #21271 adds an adoption-agency tree-construction case (
<nobr><table><marquee></table><nobr>) that webpack's HTML parser failed: the second<nobr>nested inside the first instead of being a body-level sibling. When<marquee>(or<table>) inserts a marker into the list of active formatting elements, that marker shields the open<nobr>, so the adoption agency algorithm finds no formatting element and must "act as the any-other-end-tag entry" and pop the<nobr>; thenobrstart-tag handler ignored that case. This PR fixes the handler and bumps the submodule so the new case runs in CI. Refs #21271.What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes — bumps
test/html5lib-teststo9329e64, which adds the tree-construction case exercised bytest/html5lib.spectest.js; locally the full tree-construction corpus passes with no regressions.Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
AI (Claude) was used to locate the divergence against the html5lib expected tree, identify the missing any-other-end-tag fallback in the adoption agency path, implement the fix, and validate it against the tree-construction corpus. All changes were reviewed by a maintainer.
Generated by Claude Code