GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(html): read past the whitespace collapseWhitespace removes when omitting an end tag by aryanraj45 · Pull Request #21694 · webpack/webpack Conversation
|
🦋 Changeset detectedLatest commit: b71cd23 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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Note
|
| Layer / File(s) | Summary |
|---|---|
Whitespace-aware end-tag evaluation lib/html/syntax.js |
Whitespace-only nodes and preformatted ancestors use shared checks. Optional end-tag evaluation skips whitespace removed by "all" or eligible "smart" collapsing. |
List formatting regression coverage test/HtmlSyntax.unittest.js, test/configCases/html/minimize-comments-and-whitespace/page.html, .changeset/160-html-end-tag-past-whitespace.md |
Tests and fixtures cover list-item whitespace removal and preservation of paragraph end tags inside <pre>. The changeset documents the behavior. |
Possibly related PRs
lib/html/syntax.js.lib/html/syntax.js.lib/html/syntax.js.Suggested reviewers: alexander-akait
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Title check | ❓ Inconclusive | The title uses the required Conventional Commit form and accurately describes the HTML end-tag omission fix, but the branch prefix is not provided. | Provide the branch name or confirm that its prefix is fix. |
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
Comment @coderabbitai help to get the list of available commands.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Caution CodeRabbit couldn't update its existing comment. The review summary may be out of date. Error details |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
lib/html/syntax.js (1)
8494-8501: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the new helper comments.
Keep the required JSDoc type annotations, but reduce the explanatory prose to one or two short lines.
As per coding guidelines and path instructions, comments in
lib/must be at most two short lines and add non-obvious information.Also applies to: 8503-8516, 8518-8527
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/html/syntax.js` around lines 8494 - 8501, Shorten the JSDoc comments for _isWhitespaceNode and the additional helpers at the referenced locations to one or two concise lines, while preserving the required `@param` and `@returns` type annotations. Keep only non-obvious information and remove verbose explanatory prose.Sources: Coding guidelines, Path instructions
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/html/syntax.js`:
- Around line 8552-8569: Update the whitespace-skipping logic in the surrounding
sibling traversal for both “all” and “smart” modes to require the printer’s
existing actual-removability predicate, including its
LEADING_NEWLINE_ELEMENTS/preformatted guard, before advancing past a whitespace
node. Preserve the existing mode-specific conditions, and add a regression test
covering whitespace between elements inside a preformatted ancestor such as
`<pre><p>a</p>\n<p>b</p></pre>`.
---
Nitpick comments:
In `@lib/html/syntax.js`:
- Around line 8494-8501: Shorten the JSDoc comments for _isWhitespaceNode and
the additional helpers at the referenced locations to one or two concise lines,
while preserving the required `@param` and `@returns` type annotations. Keep only
non-obvious information and remove verbose explanatory prose.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 43e3cd9b-d697-4fcc-86bc-14e19b6bdd27
test/configCases/html/minimize-comments-and-whitespace/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**test/configCases/html/minimize-comments-and-whitespace/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**.changeset/160-html-end-tag-past-whitespace.mdlib/html/syntax.jstest/HtmlSyntax.unittest.jstest/configCases/html/minimize-comments-and-whitespace/page.htmlCodeRabbit considers these linked repositories for cross-repo context during reviews:
webpack/schema-utils (auto-detected)webpack/tapable (auto-detected)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
The skip loop treated every whitespace-only sibling as removable, but the printer leaves text under a pre / textarea / listing ancestor exactly as written — so the tag went and the whitespace merged into the text before it. Both sides now ask the same guard, lifted out of the printer.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
test/configCases/html/minimize-comments-and-whitespace/page.html (1)
13-23: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd focused assertions for the new whitespace cases.
The snapshot in
test/configCases/html/minimize-comments-and-whitespace/test.config.js(Lines [11-32]) covers the full page, but its explicit assertions do not cover the added list, table, inline, or multiline<pre>output. Addexpect(page)checks for these cases. Ensure at least one assertion fails with the pre-fix output. Runyarn test:basic --testPathPatterns="ConfigTestCases"after the change.As per path instructions,
test/**requires explicitexpect()checks for behavior, andtest/configCases/**requires coverage for each added or changed line.Also applies to: 25-26
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/configCases/html/minimize-comments-and-whitespace/page.html` around lines 13 - 23, Add focused expect(page) assertions in the config-case test covering the added list, table, inline, and multiline pre whitespace output, using selectors or text checks that distinguish the expected minimized markup and ensure at least one assertion fails before the fix. Run the ConfigTestCases basic test command to verify the assertions.Source: Path instructions
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@test/configCases/html/minimize-comments-and-whitespace/page.html`:
- Around line 13-23: Add focused expect(page) assertions in the config-case test
covering the added list, table, inline, and multiline pre whitespace output,
using selectors or text checks that distinguish the expected minimized markup
and ensure at least one assertion fails before the fix. Run the ConfigTestCases
basic test command to verify the assertions.
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5d4abaf7-aea9-4f8e-bdf7-748439b2ddb0
test/configCases/html/minimize-comments-and-whitespace/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**test/configCases/html/minimize-comments-and-whitespace/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**lib/html/syntax.jstest/HtmlSyntax.unittest.jstest/configCases/html/minimize-comments-and-whitespace/page.htmlCodeRabbit considers these linked repositories for cross-repo context during reviews:
webpack/schema-utils (auto-detected)webpack/tapable (auto-detected)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
closing in favour of #21700 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.