Fix lowercase hex digit character references not being tokenized

This commit is contained in:
Shadowfacts 2024-03-17 12:08:36 -04:00
parent 3c9a5eb0ca
commit f5f42464f6
2 changed files with 8 additions and 6 deletions

View File

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

View File

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