fix: remove stray punctuation from malformed To HTML Entity table values#2660
Open
roberson-io wants to merge 1 commit into
Open
fix: remove stray punctuation from malformed To HTML Entity table values#2660roberson-io wants to merge 1 commit into
roberson-io wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three entries in the
byteToEntitytable inToHTMLEntity.mjshad stray trailing punctuation. "To HTML Entity" emits the table value verbatim, so these produced malformed output:ε,ε⇌;⇌≱;≱This addresses section 1 (malformed values) of the issue. The section 2 items — names that are well-formed but map to a different code point than the WHATWG spec (
Ω,Å,⟨/⟩,_,∽̱, and theεname itself) — involve judgment calls and are intentionally left out of this change.Existing Issue
#2645
Screenshots
N/A — no visual changes.
AI disclosure
Claude Code was used to diagnose the issue, apply the fix, and write the test. I have reviewed and understand all of the changes.
Test Coverage
Adds
tests/node/tests/ToHTMLEntity.mjs, which runs "To HTML Entity" over every BMP code point and asserts the output is an unbroken stream of well-formed entity tokens. This covers all 1,420 table entries, not just the three corrected here — any stray punctuation elsewhere in the table would also fail it. The test fails on the pre-fix table (reporting all three malformed values) and passes with the fix. It checks well-formedness only, not spec conformance, so the section 2 entries above remain green.Verified locally:
npx grunt lint,npm test(260 node + 2186 operation tests),npm run testnodeconsumer, andnpx grunt prodall pass.