Repository navigation
Conversation
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 numeric reference replacement part of #286 (
€should give€). It is independent of #288 (named entity table). The semicolon-less reference and tag-name parts of #286 are not addressed.Root cause:
CharacterReference::lookupDecimal()passed the raw number tomb_decode_numericentity()with the mask[0x0, 0x2FFFF, 0, 0xFFFF]. It never applied the numeric character reference end state rules, and the mask range cut off valid code points. Behaviour onmasterwithloadHTML('<body>…</body>'):€,€€ŸŸ��?𰀀𰀀���\x01.2089258196146E+24;Fix: in
lookupDecimal():hexdec()returns a float) map to U+FFFD.html._invalid_charrefs, which implements the same table.0x10FFFF, mask0x1FFFFF).Other code points, including the rest of the C1 range (U+0081, U+008D, …) and noncharacters, are unchanged. The spec only flags those as parse errors.
Validation (PHP 8.5,
composer:2Docker image):vendor/bin/phpunit: 176 tests OK. The newCharacterReferenceTest::testLookupNumericAppliesReplacementRulesfails onmasterand passes with this change.loadHTML()inputs from the table above now gives the spec column for every row.😀andare unchanged.