a6429f8c22
Completely removed the html5lib sanitizer. Fixed the string-handling to work in both Ruby 1.8.x and 1.9.2. There are still, inexplicably, two functional tests that fail. But the rest seems to work quite well.
105 lines
3.1 KiB
Plaintext
105 lines
3.1 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>"],
|
|
"xhtml": ["<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\">"],
|
|
"xhtml": ["<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>"],
|
|
"xhtml": ["<img />"]
|
|
},
|
|
|
|
{"description": "void element (as StartTag token)",
|
|
"input": [["StartTag", "img", {}]],
|
|
"expected": ["<img>"],
|
|
"xhtml": ["<img />"]
|
|
},
|
|
|
|
{"description": "doctype in error",
|
|
"input": [["Doctype", "foo"]],
|
|
"expected": ["<!DOCTYPE foo>"]
|
|
},
|
|
|
|
{"description": "character data",
|
|
"options": {"encoding":"utf-8"},
|
|
"input": [["Characters", "a<b>c&d"]],
|
|
"expected": ["a<b>c&d"]
|
|
},
|
|
|
|
{"description": "rcdata",
|
|
"input": [["StartTag", "script", {}], ["Characters", "a<b>c&d"]],
|
|
"expected": ["<script>a<b>c&d"],
|
|
"xhtml": ["<script>a<b>c&d"]
|
|
},
|
|
|
|
{"description": "doctype",
|
|
"input": [["Doctype", "HTML"]],
|
|
"expected": ["<!DOCTYPE HTML>"]
|
|
}
|
|
|
|
]}
|