Fix lowercase hex digit character references not being tokenized

Fixes shadowfacts/Tusker#459
This commit is contained in:
Shadowfacts 2024-03-17 12:08:36 -04:00
parent 3c9a5eb0ca
commit c26e3ee53c
2 changed files with 8 additions and 6 deletions

View File

@ -1555,12 +1555,12 @@ private extension Unicode.Scalar {
case "7": 7
case "8": 8
case "9": 9
case "A": 0xA
case "B": 0xB
case "C": 0xC
case "D": 0xD
case "E": 0xE
case "F": 0xF
case "A", "a": 0xA
case "B", "b": 0xB
case "C", "c": 0xC
case "D", "d": 0xD
case "E", "e": 0xE
case "F", "f": 0xF
default: nil
}
}

View File

@ -33,6 +33,8 @@ final class TokenizerTests: XCTestCase {
func testNumericCharacterReference() {
XCTAssertEqual(tokenize("!"), [.characterSequence("!")])
XCTAssertEqual(tokenize("!"), [.characterSequence("!")])
XCTAssertEqual(tokenize("J"), [.characterSequence("J")])
XCTAssertEqual(tokenize("J"), [.characterSequence("J")])
}
func testStartTag() {