{"tests": [ {"description":"< in attribute name", "input":"", "output":[["StartTag", "z", {"0": "", "<": ""}]], "errors":[ { "code": "unexpected-solidus-in-tag", "line": 1, "col": 4 }, { "code": "unexpected-character-in-attribute-name", "line": 1, "col": 7 } ]}, {"description":"< in unquoted attribute value", "input":"", "output":[["StartTag", "z", {"x": "<"}]], "errors":[ { "code": "unexpected-character-in-unquoted-attribute-value", "line": 1, "col": 6 } ]}, {"description":"= in unquoted attribute value", "input":"", "output":[["StartTag", "z", {"z": "z=z"}]], "errors":[ { "code": "unexpected-character-in-unquoted-attribute-value", "line": 1, "col": 7 } ]}, {"description":"= attribute", "input":"", "output":[["StartTag", "z", {"=": ""}]], "errors":[ { "code": "unexpected-equals-sign-before-attribute-name", "line": 1, "col": 4 } ]}, {"description":"== attribute", "input":"", "output":[["StartTag", "z", {"=": ""}]], "errors":[ { "code": "unexpected-equals-sign-before-attribute-name", "line": 1, "col": 4 }, { "code": "missing-attribute-value", "line": 1, "col": 6 } ]}, {"description":"=== attribute", "input":"", "output":[["StartTag", "z", {"=": "="}]], "errors":[ { "code": "unexpected-equals-sign-before-attribute-name", "line": 1, "col": 4 }, { "code": "unexpected-character-in-unquoted-attribute-value", "line": 1, "col": 6 } ]}, {"description":"==== attribute", "input":"", "output":[["StartTag", "z", {"=": "=="}]], "errors":[ { "code": "unexpected-equals-sign-before-attribute-name", "line": 1, "col": 4 }, { "code": "unexpected-character-in-unquoted-attribute-value", "line": 1, "col": 6 }, { "code": "unexpected-character-in-unquoted-attribute-value", "line": 1, "col": 7 } ]}, {"description":"\" after ampersand in double-quoted attribute value", "input":"", "output":[["StartTag", "z", {"z": "&"}]]}, {"description":"' after ampersand in double-quoted attribute value", "input":"", "output":[["StartTag", "z", {"z": "&'"}]]}, {"description":"' after ampersand in single-quoted attribute value", "input":"", "output":[["StartTag", "z", {"z": "&"}]]}, {"description":"\" after ampersand in single-quoted attribute value", "input":"", "output":[["StartTag", "z", {"z": "&\""}]]}, {"description":"Text after bogus character reference", "input":"bar", "output":[["StartTag","z",{"z":"&xlink_xmlns;"}],["Character","bar"],["StartTag","z",{}]]}, {"description":"Text after hex character reference", "input":"bar", "output":[["StartTag","z",{"z":" foo"}],["Character","bar"],["StartTag","z",{}]]}, {"description":"Attribute name starting with \"", "input":"", "output":[["StartTag", "foo", {"\"": "bar"}]], "errors":[ { "code": "unexpected-character-in-attribute-name", "line": 1, "col": 6 } ]}, {"description":"Attribute name starting with '", "input":"", "output":[["StartTag", "foo", {"'": "bar"}]], "errors":[ { "code": "unexpected-character-in-attribute-name", "line": 1, "col": 6 } ]}, {"description":"Attribute name containing \"", "input":"", "output":[["StartTag", "foo", {"a\"b": "bar"}]], "errors":[ { "code": "unexpected-character-in-attribute-name", "line": 1, "col": 7 } ]}, {"description":"Attribute name containing '", "input":"", "output":[["StartTag", "foo", {"a'b": "bar"}]], "errors":[ { "code": "unexpected-character-in-attribute-name", "line": 1, "col": 7 } ]}, {"description":"Unquoted attribute value containing '", "input":"", "output":[["StartTag", "foo", {"a": "b'c"}]], "errors":[ { "code": "unexpected-character-in-unquoted-attribute-value", "line": 1, "col": 9 } ]}, {"description":"Unquoted attribute value containing \"", "input":"", "output":[["StartTag", "foo", {"a": "b\"c"}]], "errors":[ { "code": "unexpected-character-in-unquoted-attribute-value", "line": 1, "col": 9 } ]}, {"description":"Double-quoted attribute value not followed by whitespace", "input":"", "output":[["StartTag", "foo", {"a": "b", "c": ""}]], "errors":[ { "code": "missing-whitespace-between-attributes", "line": 1, "col": 11 } ]}, {"description":"Single-quoted attribute value not followed by whitespace", "input":"", "output":[["StartTag", "foo", {"a": "b", "c": ""}]], "errors":[ { "code": "missing-whitespace-between-attributes", "line": 1, "col": 11 } ]}, {"description":"Quoted attribute followed by permitted /", "input":"
", "output":[["StartTag","br",{"a":"b"},true]]}, {"description":"Quoted attribute followed by non-permitted /", "input":"", "output":[["StartTag","bar",{"a":"b"},true]]}, {"description":"CR EOF after doctype name", "input":"", "output":[["StartTag", "x", {}]]}, {"description":"Uppercase end tag name", "input":"", "output":[["EndTag", "x"]]}, {"description":"Uppercase attribute name", "input":"", "output":[["StartTag", "x", { "x":"" }]]}, {"description":"Tag/attribute name case edge values", "input":"", "output":[["StartTag", "x@az[`az{", { "@az[`az{":"" }]]}, {"description":"Duplicate different-case attributes", "input":"", "output":[["StartTag", "x", { "x":"1" }]], "errors":[ { "code": "duplicate-attribute", "line": 1, "col": 9 }, { "code": "duplicate-attribute", "line": 1, "col": 13 } ]}, {"description":"Uppercase close tag attributes", "input":"", "output":[["EndTag", "x"]], "errors":[ { "code": "end-tag-with-attributes", "line": 1, "col": 6 } ]}, {"description":"Duplicate close tag attributes", "input":"", "output":[["EndTag", "x"]], "errors":[ { "code": "duplicate-attribute", "line": 1, "col": 8 }, { "code": "end-tag-with-attributes", "line": 1, "col": 8 } ]}, {"description":"Permitted slash", "input":"
", "output":[["StartTag","br",{},true]]}, {"description":"Non-permitted slash", "input":"", "output":[["StartTag","xr",{},true]]}, {"description":"Permitted slash but in close tag", "input":"
", "output":[["EndTag", "br"]], "errors":[ { "code": "end-tag-with-trailing-solidus", "line": 1, "col": 6 } ]}, {"description":"Doctype public case-sensitivity (1)", "input":"", "output":[["DOCTYPE", "html", "AbC", "XyZ", true]]}, {"description":"Doctype public case-sensitivity (2)", "input":"", "output":[["DOCTYPE", "html", "aBc", "xYz", true]]}, {"description":"Doctype system case-sensitivity (1)", "input":"", "output":[["DOCTYPE", "html", null, "XyZ", true]]}, {"description":"Doctype system case-sensitivity (2)", "input":"", "output":[["DOCTYPE", "html", null, "xYz", true]]}, {"description":"U+0000 in lookahead region after non-matching character", "input":"\u0000", "output":[["Comment", "doc"], ["Character", "\u0000"]], "errors":[ { "code": "incorrectly-opened-comment", "line": 1, "col": 3 }, { "code": "unexpected-null-character", "line": 1, "col": 7 } ]}, {"description":"U+0000 in lookahead region", "input":"", "output":[["DOCTYPE", "html", null, null, false]], "errors":[ { "code": "invalid-character-sequence-after-doctype-name", "line": 1, "col": 16 } ]}, {"description":"Doctype publi", "input":"", "output":[["DOCTYPE", "html", null, null, false]], "errors":[ { "code": "invalid-character-sequence-after-doctype-name", "line": 1, "col": 16 } ]}, {"description":"Doctype sys", "input":"text", "input":"text", "output":[["DOCTYPE", "html", null, null, false], ["Character", "text"]], "errors":[ { "code": "invalid-character-sequence-after-doctype-name", "line": 1, "col": 16 } ]}, {"description":"Grave accent in unquoted attribute", "input":"", "output":[["StartTag", "a", {"a":"aa`"}]], "errors":[ { "code": "unexpected-character-in-unquoted-attribute-value", "line": 1, "col": 8 } ]}, {"description":"EOF in tag name state ", "input":"