[ { "name": "Template content", "input": "", "expected": "" }, { "name": "Attributes", "input": "
", "expected": "
" }, { "name": "Attribute serialized name - XML namespace", "input": "", "expected": "" }, { "name": "Attribute serialized name - XMLNS namespace", "input": "" }, { "name": "Attribute serialized name - XLink namespace", "input": "", "expected": "" }, { "name": "Attribute value escaping - &", "input": "
", "expected": "
" }, { "name": "Attribute value escaping -  ", "input": "
", "expected": "
" }, { "name": "Attribute value escaping - quotes", "input": "
", "expected": "
" }, { "name": "Attribute value escaping - < and >", "input": "
\">
", "expected": "
\">
" }, { "name": "Attributes value escaping - other entities", "input": "
", "expected": "
" }, { "name": "Void elements", "input": "

", "expected": "

" }, { "name": "Void elements - ", "input": "
", "expected": "
" }, { "name": "Void elements - ", "input": "", "expected": "" }, { "name": "Text nodes", "input": "foofoo
bar
baz", "expected": "foofoo
bar
baz" }, { "name": "Text nodes escaping - &", "input": "Mac&Cheese
&&&
", "expected": "Mac&Cheese
&&&
" }, { "name": "Text nodes escaping -  ", "input": "\u00A0foo\u00A0bar\u00A0
\u00A0baz\u00A0
", "expected": " foo bar 
 baz 
" }, { "name": "Text nodes escaping - < and >", "input": "< foo >
> bar <
", "expected": "< foo >
> bar <
" }, { "name": "Text nodes escaping - quotes", "input": "\"foo\"
\"bar\"
", "expected": "\"foo\"
\"bar\"
" }, { "name": "Text nodes escaping - non-escapable tags", "input": "&\u00A0><&\u00A0><&\u00A0><&\u00A0><", "expected": "<html><head></head><body><style>&\u00A0><</style><script>&\u00A0><</script><xmp>&\u00A0><</xmp><iframe>&\u00A0><</iframe><noembed>&\u00A0><</noembed><noframes>&\u00A0><</noframes><plaintext>&\u00A0><</plaintext></body></html>" }, { "name": "Text nodes escaping - <noscript> with scripting enabled", "input": "<body><noscript>& ><</noscript></body>", "expected": "<html><head></head><body><noscript>& ><</noscript></body></html>" }, { "name": "Text nodes escaping - <noscript> with scripting disabled (GH-332)", "options": { "scriptingEnabled": false }, "input": "<body><noscript>& ><</noscript></body>", "expected": "<html><head></head><body><noscript>&amp; &gt;&lt;</noscript></body></html>" }, { "name": "Comment nodes", "input": "<!-- Hey --><html><head></head><!-- &\u00A0>< --><body><!-- 42 --></body></html>", "expected": "<!-- Hey --><html><head></head><!-- &\u00A0>< --><body><!-- 42 --></body></html>" }, { "name": "Doctype without systemId and publicId", "input": "<!DOCTYPE html>", "expected": "<!DOCTYPE html><html><head></head><body></body></html>" }, { "name": "Doctype with publicId", "input": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\">", "expected": "<!DOCTYPE html><html><head></head><body></body></html>" }, { "name": "Doctype with systemId", "input": "<!DOCTYPE html SYSTEM \"http://www.w3.org/DTD/HTML4-strict.dtd\"", "expected": "<!DOCTYPE html><html><head></head><body></body></html>" }, { "name": "Doctype with publicId and systemId", "input": "<!DOCTYPE html html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"", "expected": "<!DOCTYPE html><html><head></head><body></body></html>" }, { "name": "Child nodes", "input": "<span><a><b><c></c></b><d>e</d><f><g>h</g></f></a></span>", "expected": "<html><head></head><body><span><a><b><c></c></b><d>e</d><f><g>h</g></f></a></span></body></html>" }, { "name": "<pre>, <textarea>, <listing> with initial LF (see: https://github.com/whatwg/html/pull/1815)", "input": "<pre>\n1</pre><pre>\n\n2</pre><textarea>\n3</textarea><textarea>\n\n4</textarea><listing>\n5</listing><listing>\n\n6</listing>", "expected": "<html><head></head><body><pre>1</pre><pre>\n2</pre><textarea>3</textarea><textarea>\n4</textarea><listing>5</listing><listing>\n6</listing></body></html>" }, { "name": "Mixed content (GH-333)", "input": "<svg><style>&lt;</style></svg><style>&lt;</style><svg><script>&lt;</script></svg><script>&lt;</script>", "expected": "<html><head></head><body><svg><style>&lt;</style></svg><style>&lt;</style><svg><script>&lt;</script></svg><script>&lt;</script></body></html>" } ]