{"tests": [ {"description":"Correct Doctype lowercase", "input":"", "output":[["DOCTYPE", "html", null, null, true]]}, {"description":"Correct Doctype uppercase", "input":"", "output":[["DOCTYPE", "HTML", null, null, true]]}, {"description":"Correct Doctype mixed case", "input":"", "output":[["DOCTYPE", "HtMl", null, null, true]]}, {"description":"Truncated doctype start", "input":"", "output":["ParseError", ["Comment", "DOC"]]}, {"description":"Doctype in error", "input":"", "output":[["DOCTYPE", "foo", null, null, true]]}, {"description":"Single Start Tag", "input":"", "output":[["StartTag", "h", {}]]}, {"description":"Empty end tag", "input":"", "output":["ParseError"]}, {"description":"Empty start tag", "input":"<>", "output":["ParseError", ["Character", "<>"]]}, {"description":"Start Tag w/attribute", "input":"", "output":[["StartTag", "h", {"a":"b"}]]}, {"description":"Start Tag w/attribute no quotes", "input":"", "output":[["StartTag", "h", {"a":"b"}]]}, {"description":"Start/End Tag", "input":"", "output":[["StartTag", "h", {}], ["EndTag", "h"]]}, {"description":"Two unclosed start tags", "input":"

One

Two", "output":[["StartTag", "p", {}], ["Character", "One"], ["StartTag", "p", {}], ["Character", "Two"]]}, {"description":"End Tag w/attribute", "input":"", "output":[["StartTag", "h", {}], "ParseError", ["EndTag", "h"]]}, {"description":"Multiple atts", "input":"", "output":[["StartTag", "h", {"a":"b", "c":"d"}]]}, {"description":"Multiple atts no space", "input":"", "output":[["StartTag", "h", {"a":"b", "c":"d"}]]}, {"description":"Repeated attr", "input":"", "output":["ParseError", ["StartTag", "h", {"a":"b"}]]}, {"description":"Simple comment", "input":"", "output":[["Comment", "comment"]]}, {"description":"Comment, Central dash no space", "input":"", "output":["ParseError", ["Comment", "-"]]}, {"description":"Comment, two central dashes", "input":"", "output":["ParseError", ["Comment", " --comment "]]}, {"description":"Unfinished comment", "input":"", "output":["ParseError", ["Comment", ""]]}, {"description":"Short comment two", "input":"", "output":["ParseError", ["Comment", ""]]}, {"description":"Short comment three", "input":"", "output":[["Comment", ""]]}, {"description":"Ampersand EOF", "input":"&", "output":[["Character", "&"]]}, {"description":"Ampersand ampersand EOF", "input":"&&", "output":[["Character", "&&"]]}, {"description":"Ampersand space EOF", "input":"& ", "output":[["Character", "& "]]}, {"description":"Unfinished entity", "input":"&f", "output":["ParseError", ["Character", "&f"]]}, {"description":"Ampersand, number sign", "input":"&#", "output":["ParseError", ["Character", "&#"]]}, {"description":"Unfinished numeric entity", "input":"&#x", "output":["ParseError", ["Character", "&#x"]]}, {"description":"Entity with trailing semicolon (1)", "input":"I'm ¬it", "output":[["Character","I'm ¬it"]]}, {"description":"Entity with trailing semicolon (2)", "input":"I'm ∉", "output":[["Character","I'm ∉"]]}, {"description":"Entity without trailing semicolon (1)", "input":"I'm ¬it", "output":[["Character","I'm "], "ParseError", ["Character", "¬it"]]}, {"description":"Entity without trailing semicolon (2)", "input":"I'm ¬in", "output":[["Character","I'm "], "ParseError", ["Character", "¬in"]]}, {"description":"Partial entity match at end of file", "input":"I'm &no", "output":[["Character","I'm "], "ParseError", ["Character", "&no"]]}, {"description":"ASCII decimal entity", "input":"$", "output":[["Character","$"]]}, {"description":"ASCII hexadecimal entity", "input":"?", "output":[["Character","?"]]}, {"description":"Hexadecimal entity in attribute", "input":"", "output":[["StartTag", "h", {"a":"?"}], ["EndTag", "h"]]}, {"description":"Entity in attribute without semicolon ending in x", "input":"", "output":["ParseError", ["StartTag", "h", {"a":"¬x"}]]}, {"description":"Entity in attribute without semicolon ending in 1", "input":"", "output":["ParseError", ["StartTag", "h", {"a":"¬1"}]]}, {"description":"Entity in attribute without semicolon ending in i", "input":"", "output":["ParseError", ["StartTag", "h", {"a":"¬i"}]]}, {"description":"Entity in attribute without semicolon", "input":"", "output":["ParseError", ["StartTag", "h", {"a":"©"}]]} ]}