{"tests": [ {"description":"DOCTYPE without name", "input":"", "output":[["DOCTYPE", null, null, null, false]], "errors":[ { "code": "missing-doctype-name", "line": 1, "col": 10 } ]}, {"description":"DOCTYPE without space before name", "input":"", "output":[["DOCTYPE", "html", null, null, true]], "errors":[ { "code": "missing-whitespace-before-doctype-name", "line": 1, "col": 10 } ]}, {"description":"Incorrect DOCTYPE without a space before name", "input":"", "output":[["DOCTYPE", "foo", null, null, true]], "errors":[ { "code": "missing-whitespace-before-doctype-name", "line": 1, "col": 10 } ]}, {"description":"DOCTYPE with publicId", "input":"", "output":[["DOCTYPE", "html", "-//W3C//DTD HTML Transitional 4.01//EN", null, true]]}, {"description":"DOCTYPE with EOF after PUBLIC", "input":"", "output":[["DOCTYPE", "html", null, "-//W3C//DTD HTML Transitional 4.01//EN", true]]}, {"description":"DOCTYPE with single-quoted systemId", "input":"", "output":[["DOCTYPE", "html", null, "-//W3C//DTD HTML Transitional 4.01//EN", true]]}, {"description":"DOCTYPE with publicId and systemId", "input":"", "output":[["DOCTYPE", "html", "-//W3C//DTD HTML Transitional 4.01//EN", "-//W3C//DTD HTML Transitional 4.01//EN", true]]}, {"description":"DOCTYPE with > in double-quoted publicId", "input":"x", "output":[["DOCTYPE", "html", "", null, false], ["Character", "x"]], "errors": [ { "code": "abrupt-doctype-public-identifier", "col": 24, "line": 1 } ]}, {"description":"DOCTYPE with > in single-quoted publicId", "input":"x", "output":[["DOCTYPE", "html", "", null, false], ["Character", "x"]], "errors": [ { "code": "abrupt-doctype-public-identifier", "col": 24, "line": 1 } ]}, {"description":"DOCTYPE with > in double-quoted systemId", "input":"x", "output":[["DOCTYPE", "html", "foo", "", false], ["Character", "x"]], "errors": [ { "code": "abrupt-doctype-system-identifier", "col": 30, "line": 1 } ]}, {"description":"DOCTYPE with > in single-quoted systemId", "input":"x", "output":[["DOCTYPE", "html", "foo", "", false], ["Character", "x"]], "errors": [ { "code": "abrupt-doctype-system-identifier", "col": 30, "line": 1 } ]}, {"description":"Incomplete doctype", "input":"", "output":[["StartTag", "h", { "a":"&" }]]}, {"description":"StartTag containing <", "input":"", "output":[["StartTag", "a", "output":[["StartTag","h",{},true]]}, {"description":"Void element with permitted slash", "input":"
", "output":[["StartTag","br",{},true]]}, {"description":"Void element with permitted slash (with attribute)", "input":"
", "output":[["StartTag","br",{"foo":"bar"},true]]}, {"description":"StartTag containing /", "input":"", "output":[["StartTag", "h", { "a":"b" }]], "errors":[ { "code": "unexpected-solidus-in-tag", "line": 1, "col": 4 } ]}, {"description":"Double-quoted attribute value", "input":"", "output":[["StartTag", "h", { "a":"b" }]]}, {"description":"Unescaped ", "output":[["Comment", "1"]], "errors":[ { "code": "invalid-first-character-of-tag-name", "line": 1, "col": 3 } ]}, {"description":"Simili processing instruction", "input":"", "output":[["Comment", "?namespace"]], "errors":[ { "code": "unexpected-question-mark-instead-of-tag-name", "line": 1, "col": 2 } ]}, {"description":"A bogus comment stops at >, even if preceded by two dashes", "input":"", "output":[["Comment", "?foo--"]], "errors":[ { "code": "unexpected-question-mark-instead-of-tag-name", "line": 1, "col": 2 } ]}, {"description":"Unescaped <", "input":"foo < bar", "output":[["Character", "foo < bar"]], "errors":[ { "code": "invalid-first-character-of-tag-name", "line": 1, "col": 6 } ]}, {"description":"Null Byte Replacement", "input":"\u0000", "output":[["Character", "\u0000"]], "errors":[ { "code": "unexpected-null-character", "line": 1, "col": 1 } ]}, {"description":"Comment with dash", "input":"c", "output":[["Character", "a"], ["Comment", "b"], ["Character", "c"]], "errors":[ { "code": "missing-end-tag-name", "line": 1, "col": 4 } ]}, {"description":"Empty end tag with following end tag", "input":"ac", "output":[["Character", "a"], ["EndTag", "b"], ["Character", "c"]], "errors":[ { "code": "missing-end-tag-name", "line": 1, "col": 4 } ]} ]}