Repository navigation
Conversation
…table Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This branch has not been deployed
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.
Fixes the named character reference table part of #286 (the
≖,⊚,⩝,∥and⊃cases). The numeric reference, semicolon-less reference and tag-name parts of that issue are not addressed here.Root cause:
entities.jsonlists each legacy entity twice, asêand asê(no semicolon).bin/entities.phpstripped the first and last character from every key (substr($name, 1, -1)). That is right forê, butêbecameecir. These fake names overwrote the real WHATWG entities that share the prefix:ecirê(U+00EA)≖(U+2256)ocirô(U+00F4)⊚(U+229A)ordº(U+00BA)⩝(U+2A5D)par¶(U+00B6)∥(U+2225)sup³(U+00B3)⊃(U+2283)The bug also added 97 names that do not exist (
Aacut,am,cop,brvba, ...). For example,&Aacut;decoded toÁ, but per spec it should stay literal.Fix:
bin/entities.phpnow only keeps keys ending in;. The tokenizer always requires the;, and every semicolon-less legacy name is also listed with one, so nothing valid is lost.src/HTML5/Entities.phpgets the same result: the 97 truncated keys are removed and the 5 values above are corrected. I edited the existing file in place instead of re-running the script, which fetches from the network, so the formatting stays the same.I compared the result with the WHATWG table (Python's
html.entities.html5, semicolon names only). All 2125 names match and there are no extra keys.Validation (PHP 8.5,
composer:2Docker image):vendor/bin/phpunit: 176 tests OK. The newCharacterReferenceTest::testLookupNameDoesNotTruncateLegacyNamesfails onmaster('≖'expected,'ê'actual) and passes with this change.loadHTML('<body>…</body>'),≖gives≖,⊚gives⊚,⊃gives⊃,ÁgivesÁ, and&Aacut;stays literal.