{"tests": [ {"description":"DOCTYPE without name", "input":"", "output":["ParseError", "ParseError", ["DOCTYPE", "", null, null, false]]}, {"description":"DOCTYPE without space before name", "input":"", "output":["ParseError", ["DOCTYPE", "html", null, null, true]]}, {"description":"Incorrect DOCTYPE without a space before name", "input":"", "output":["ParseError", ["DOCTYPE", "foo", null, null, true]]}, {"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 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":["ParseError", ["DOCTYPE", "html", "", null, false], ["Character", "x"]]}, {"description":"DOCTYPE with > in single-quoted publicId", "input":"x", "output":["ParseError", ["DOCTYPE", "html", "", null, false], ["Character", "x"]]}, {"description":"DOCTYPE with > in double-quoted systemId", "input":"x", "output":["ParseError", ["DOCTYPE", "html", "foo", "", false], ["Character", "x"]]}, {"description":"DOCTYPE with > in single-quoted systemId", "input":"x", "output":["ParseError", ["DOCTYPE", "html", "foo", "", false], ["Character", "x"]]}, {"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":["ParseError", ["StartTag", "h", { "a":"b" }]]}, {"description":"Double-quoted attribute value", "input":"", "output":[["StartTag", "h", { "a":"b" }]]}, {"description":"Unescaped ", "output":["ParseError", ["Comment", "1"]]}, {"description":"Simili processing instruction", "input":"", "output":["ParseError", ["Comment", "?namespace"]]}, {"description":"A bogus comment stops at >, even if preceeded by two dashes", "input":"", "output":["ParseError", ["Comment", "?foo--"]]}, {"description":"Unescaped <", "input":"foo < bar", "output":[["Character", "foo "], "ParseError", ["Character", "< bar"]]}, {"description":"Null Byte Replacement", "input":"\u0000", "output":["ParseError", ["Character", "\u0000"]]}, {"description":"Comment with dash", "input":"c", "output":[["Character", "a"], "ParseError", ["Comment", "b"], ["Character", "c"]]}, {"description":"Empty end tag with following end tag", "input":"ac", "output":[["Character", "a"], "ParseError", ["EndTag", "b"], ["Character", "c"]]} ]}