89 lines
2.6 KiB
Plaintext
89 lines
2.6 KiB
Plaintext
{"tests": [
|
|
|
|
{"description": "proper attribute value escaping",
|
|
"input": [["StartTag", "span", {"title": "test \"with\" ""}]],
|
|
"expected": ["<span title='test \"with\" &quot;'>"]
|
|
},
|
|
|
|
{"description": "proper attribute value non-quoting",
|
|
"input": [["StartTag", "span", {"title": "foo"}]],
|
|
"expected": ["<span title=foo>"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with >)",
|
|
"input": [["StartTag", "span", {"title": "foo>bar"}]],
|
|
"expected": ["<span title=\"foo>bar\">"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with <)",
|
|
"input": [["StartTag", "span", {"title": "foo<bar"}]],
|
|
"expected": ["<span title=\"foo<bar\">"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with \")",
|
|
"input": [["StartTag", "span", {"title": "foo\"bar"}]],
|
|
"expected": ["<span title='foo\"bar'>"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with ')",
|
|
"input": [["StartTag", "span", {"title": "foo'bar"}]],
|
|
"expected": ["<span title=\"foo'bar\">"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with both \" and ')",
|
|
"input": [["StartTag", "span", {"title": "foo'bar\"baz"}]],
|
|
"expected": ["<span title=\"foo'bar"baz\">"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with space)",
|
|
"input": [["StartTag", "span", {"title": "foo bar"}]],
|
|
"expected": ["<span title=\"foo bar\">"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with tab)",
|
|
"input": [["StartTag", "span", {"title": "foo\tbar"}]],
|
|
"expected": ["<span title=\"foo\tbar\">"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with LF)",
|
|
"input": [["StartTag", "span", {"title": "foo\nbar"}]],
|
|
"expected": ["<span title=\"foo\nbar\">"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with CR)",
|
|
"input": [["StartTag", "span", {"title": "foo\rbar"}]],
|
|
"expected": ["<span title=\"foo\rbar\">"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with linetab)",
|
|
"input": [["StartTag", "span", {"title": "foo\u000Bbar"}]],
|
|
"expected": ["<span title=\"foo\u000Bbar\">"]
|
|
},
|
|
|
|
{"description": "proper attribute value quoting (with form feed)",
|
|
"input": [["StartTag", "span", {"title": "foo\u000Cbar"}]],
|
|
"expected": ["<span title=\"foo\u000Cbar\">"]
|
|
},
|
|
|
|
{"description": "void element (as EmptyTag token)",
|
|
"input": [["EmptyTag", "img", {}]],
|
|
"expected": ["<img>"]
|
|
},
|
|
|
|
{"description": "void element (as StartTag token)",
|
|
"input": [["StartTag", "img", {}]],
|
|
"expected": ["<img>"]
|
|
},
|
|
|
|
{"description": "doctype in error",
|
|
"input": [["Doctype", "foo"]],
|
|
"expected": ["<!DOCTYPE foo>"]
|
|
},
|
|
|
|
{"description": "doctype",
|
|
"input": [["Doctype", "HTML"]],
|
|
"expected": ["<!DOCTYPE HTML>"]
|
|
}
|
|
|
|
]}
|