2007-06-12 06:33:06 +02:00
|
|
|
{"tests":[
|
|
|
|
|
|
|
|
{"description": "quote_char=\"'\"",
|
|
|
|
"options": {"quote_char": "'"},
|
|
|
|
"input": [["StartTag", "span", {"title": "test 'with' quote_char"}]],
|
|
|
|
"expected": ["<span title='test 'with' quote_char'>"]
|
|
|
|
},
|
|
|
|
|
|
|
|
{"description": "quote_attr_values=true",
|
|
|
|
"options": {"quote_attr_values": true},
|
|
|
|
"input": [["StartTag", "button", {"disabled": "disabled"}]],
|
2007-06-22 10:12:08 +02:00
|
|
|
"expected": ["<button disabled>"],
|
|
|
|
"xhtml": ["<button disabled=\"disabled\">"]
|
2007-06-12 06:33:06 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
{"description": "quote_attr_values=true with irrelevant",
|
|
|
|
"options": {"quote_attr_values": true},
|
|
|
|
"input": [["StartTag", "div", {"irrelevant": "irrelevant"}]],
|
2007-06-22 10:12:08 +02:00
|
|
|
"expected": ["<div irrelevant>"],
|
|
|
|
"xhtml": ["<div irrelevant=\"irrelevant\">"]
|
2007-06-12 06:33:06 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
{"description": "use_trailing_solidus=true with void element",
|
|
|
|
"options": {"use_trailing_solidus": true},
|
|
|
|
"input": [["EmptyTag", "img", {}]],
|
|
|
|
"expected": ["<img />"]
|
|
|
|
},
|
|
|
|
|
|
|
|
{"description": "use_trailing_solidus=true with non-void element",
|
|
|
|
"options": {"use_trailing_solidus": true},
|
|
|
|
"input": [["StartTag", "div", {}]],
|
|
|
|
"expected": ["<div>"]
|
|
|
|
},
|
|
|
|
|
|
|
|
{"description": "minimize_boolean_attributes=false",
|
|
|
|
"options": {"minimize_boolean_attributes": false},
|
|
|
|
"input": [["StartTag", "div", {"irrelevant": "irrelevant"}]],
|
2007-06-22 10:12:08 +02:00
|
|
|
"expected": ["<div irrelevant=irrelevant>"],
|
|
|
|
"xhtml": ["<div irrelevant=\"irrelevant\">"]
|
2007-06-12 06:33:06 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
{"description": "minimize_boolean_attributes=false with empty value",
|
|
|
|
"options": {"minimize_boolean_attributes": false},
|
|
|
|
"input": [["StartTag", "div", {"irrelevant": ""}]],
|
|
|
|
"expected": ["<div irrelevant=\"\">"]
|
2007-06-22 10:12:08 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
{"description": "escape less than signs in attribute values",
|
|
|
|
"options": {"escape_lt_in_attrs": true},
|
|
|
|
"input": [["StartTag", "a", {"title": "a<b>c&d"}]],
|
|
|
|
"expected": ["<a title=\"a<b>c&d\">"]
|
2007-07-05 00:36:59 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
{"description": "rcdata",
|
|
|
|
"options": {"escape_rcdata": true},
|
|
|
|
"input": [["StartTag", "script", {}], ["Characters", "a<b>c&d"]],
|
|
|
|
"expected": ["<script>a<b>c&d"]
|
2007-06-12 06:33:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
]}
|