Skip to content

fix: remove stray punctuation from malformed To HTML Entity table values#2660

Open
roberson-io wants to merge 1 commit into
gchq:masterfrom
roberson-io:fix/tohtmlentity-stray-punctuation
Open

fix: remove stray punctuation from malformed To HTML Entity table values#2660
roberson-io wants to merge 1 commit into
gchq:masterfrom
roberson-io:fix/tohtmlentity-stray-punctuation

Conversation

@roberson-io

Copy link
Copy Markdown

Description

Three entries in the byteToEntity table in ToHTMLEntity.mjs had stray trailing punctuation. "To HTML Entity" emits the table value verbatim, so these produced malformed output:

Code point Char Before After
1013 (U+03F5) ϵ ε, ε
8652 (U+21CC) ⇌; ⇌
8817 (U+2271) ≱; ≱

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, and npx grunt prod all pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant