diff --git a/tokenizer/parse5-regressions.test b/tokenizer/parse5-regressions.test new file mode 100644 index 0000000..f11bd37 --- /dev/null +++ b/tokenizer/parse5-regressions.test @@ -0,0 +1,41 @@ +{ + "tests": [ + { + "description": "Two-code-point named character reference followed by text and a start tag", + "input": " <⃒text", + "output": [ + [ + "Character", + " <\u20d2text" + ], + [ + "StartTag", + "a", + {} + ] + ] + }, + { + "description": "Tag open lookahead after a long whitespace run", + "input": " <", + "output": [ + [ + "Character", + " <" + ], + [ + "StartTag", + "x", + {} + ] + ], + "errors": [ + { + "code": "invalid-first-character-of-tag-name", + "line": 1, + "col": 65539 + } + ] + } + ] +} diff --git a/tokenizer/unicodeCharsProblematic.test b/tokenizer/unicodeCharsProblematic.test index 3ddb96c..d7a6e76 100644 --- a/tokenizer/unicodeCharsProblematic.test +++ b/tokenizer/unicodeCharsProblematic.test @@ -36,6 +36,30 @@ "output":[["Character", "\n\u0000"]], "errors":[ { "code": "unexpected-null-character", "line": 2, "col": 1 } -]} +]}, + +{ + "description": "Consecutive low surrogates followed by a valid surrogate pair", + "doubleEscaped": true, + "input": "\\uDC00\\uDC00\\uD83D\\uDE00", + "output": [ + [ + "Character", + "\\uDC00\\uDC00\\uD83D\\uDE00" + ] + ], + "errors": [ + { + "code": "surrogate-in-input-stream", + "line": 1, + "col": 1 + }, + { + "code": "surrogate-in-input-stream", + "line": 1, + "col": 2 + } + ] +} ] } \ No newline at end of file