JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
switch to tests from html5lib-tests/tree-construction
authorJason Woofenden <jason@jasonwoof.com>
Tue, 22 Dec 2015 03:48:43 +0000 (22:48 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Tue, 22 Dec 2015 03:48:43 +0000 (22:48 -0500)
Makefile
index.html
parse-html.coffee
test.coffee [new file with mode: 0644]

index 24c826c..2e57917 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-all: parse-html.js
+all: parse-html.js test.js
 
-parse-html.js: parse-html.coffee
+%.js: %.coffee
        coffee -c $<
index f27ccb2..5750538 100644 (file)
@@ -3,6 +3,7 @@
 <head>
        <title>html parser tester</title>
        <script src="parse-html.js"></script>
+       <script src="test.js"></script>
 </head>
 <body>
        <p>check the console for test results</p>
index c6ed9a5..385a2a0 100644 (file)
 #   0: a "end of the list", "current node", "bottommost", "last"
 
 
+# browser
+# note: to get this to run outside a browser, you'll have to write a native
+# implementation of decode_named_char_ref()
+unless module?.exports?
+       window.wheic = {}
+       module = exports: window.wheic
 
 # Each node is an obect of the Node class. Here are the Node types:
 TYPE_TAG = 0 # name, {attributes}, [children]
@@ -2776,15 +2782,6 @@ parse_html = (txt, parse_error_cb = null) ->
                        # fixfull parse error if has self-closing flag, but it wasn't acknolwedged
        return doc.children
 
-test_results = passed: 0, failed: 0
-# everything below is tests on the above
-test_equals = (description, output, expected_output) ->
-       if output is expected_output
-               console.log "passed." # don't say name, so smart consoles can merge all of these
-       else
-               console.log "FAILED: \"#{description}\""
-               console.log "   Expected: #{expected_output}"
-               console.log "     Actual: #{output}"
 serialize_els = (els, shallow, show_ids) ->
        serialized = ''
        sep = ''
@@ -2793,205 +2790,12 @@ serialize_els = (els, shallow, show_ids) ->
                sep = ','
                serialized += t.serialize shallow, show_ids
        return serialized
-test_parser = (args) ->
-       debug_log_reset()
-       parse_errors = []
-       errors_cb = (i) ->
-               parse_errors.push i
-       prev_node_id = 0 # reset counter
-       parsed = parse_html args.html, errors_cb
-       serialized = serialize_els parsed, false, false
-       expected = 'tag:"html",{},[tag:"head",{},[],tag:"body",{},[' + args.expected + ']]'
-       if serialized isnt expected
-               debug_log_each (str) ->
-                       console.log str
-               console.log "FAILED: \"#{args.name}\""
-               console.log "      Input: #{args.html}"
-               console.log "    Correct: #{expected}"
-               console.log "     Output: #{serialized}"
-               if parse_errors.length > 0
-                       console.log " parse errs: #{JSON.stringify parse_errors}"
-               else
-                       console.log "   No parse errors"
-               test_results.failed += 1
-       else
-               #console.log "passed \"#{args.name}\""
-               test_results.passed += 1
-test_summary = ->
-       console.log "Tests passed: #{test_results.passed}"
-       console.log "Tests Failed: #{test_results.failed}"
-
-test_parser name: "empty", \
-       html: "",
-       expected: ''
-test_parser name: "just text", \
-       html: "abc",
-       expected: 'text:"abc"'
-test_parser name: "named entity", \
-       html: "a&amp;1234",
-       expected: 'text:"a&1234"'
-test_parser name: "broken named character references", \
-       html: "1&amp2&&amp;3&aabbcc;",
-       expected: 'text:"1&2&&3&aabbcc;"'
-test_parser name: "numbered entity overrides", \
-       html: "1&#X80&#x80; &#x83",
-       expected: 'text:"1€€ ƒ"'
-test_parser name: "open tag", \
-       html: "foo<span>bar",
-       expected: 'text:"foo",tag:"span",{},[text:"bar"]'
-test_parser name: "open tag with attributes", \
-       html: "foo<span style=\"foo: bar\" title=\"hi\">bar",
-       expected: 'text:"foo",tag:"span",{"style":"foo: bar","title":"hi"},[text:"bar"]'
-test_parser name: "open tag with attributes of various quotings", \
-       html: "foo<span abc=\"def\" g=hij klm='nopqrstuv\"' autofocus>bar",
-       expected: 'text:"foo",tag:"span",{"abc":"def","autofocus":"","g":"hij","klm":"nopqrstuv\\""},[text:"bar"]'
-test_parser name: "attribute entity exceptions dq", \
-       html: "foo<a href=\"foo?t=1&amp=2&ampo=3&amp;lt=foo\">bar",
-       expected: 'text:"foo",tag:"a",{"href":"foo?t=1&amp=2&ampo=3&lt=foo"},[text:"bar"]'
-test_parser name: "attribute entity exceptions sq", \
-       html: "foo<a href='foo?t=1&amp=2&ampo=3&amp;lt=foo'>bar",
-       expected: 'text:"foo",tag:"a",{"href":"foo?t=1&amp=2&ampo=3&lt=foo"},[text:"bar"]'
-test_parser name: "attribute entity exceptions uq", \
-       html: "foo<a href=foo?t=1&amp=2&ampo=3&amp;lt=foo>bar",
-       expected: 'text:"foo",tag:"a",{"href":"foo?t=1&amp=2&ampo=3&lt=foo"},[text:"bar"]'
-test_parser name: "matching closing tags", \
-       html: "foo<a href=\"hi\">hi</a><div>1<div>foo</div>2</div>bar",
-       expected: 'text:"foo",tag:"a",{"href":"hi"},[text:"hi"],tag:"div",{},[text:"1",tag:"div",{},[text:"foo"],text:"2"],text:"bar"'
-test_parser name: "missing closing tag inside", \
-       html: "foo<div>bar<span>baz</div>qux",
-       expected: 'text:"foo",tag:"div",{},[text:"bar",tag:"span",{},[text:"baz"]],text:"qux"'
-test_parser name: "mis-matched closing tags", \
-       html: "<span>12<div>34</span>56</div>78",
-       expected: 'tag:"span",{},[text:"12",tag:"div",{},[text:"3456"],text:"78"]'
-test_parser name: "mis-matched formatting elements", \
-       html: "12<b>34<i>56</b>78</i>90",
-       expected: 'text:"12",tag:"b",{},[text:"34",tag:"i",{},[text:"56"]],tag:"i",{},[text:"78"],text:"90"'
-test_parser name: "8.2.8.1 Misnested tags: <b><i></b></i>", \
-       html: '<p>1<b>2<i>3</b>4</i>5</p>',
-       expected: 'tag:"p",{},[text:"1",tag:"b",{},[text:"2",tag:"i",{},[text:"3"]],tag:"i",{},[text:"4"],text:"5"]'
-test_parser name: "8.2.8.2 Misnested tags: <b><p></b></p>", \
-       html: '<b>1<p>2</b>3</p>',
-       expected: 'tag:"b",{},[text:"1"],tag:"p",{},[tag:"b",{},[text:"2"],text:"3"]'
-test_parser name: "crazy formatting elements test", \
-       html: "<b><i><a><s><tt><div></b>first</b></div></tt></s></a>second</i>",
-       # chrome does this: expected: 'tag:"b",{},[tag:"i",{},[tag:"a",{},[tag:"s",{},[tag:"tt",{},[]]],text:"second"]],tag:"a",{},[tag:"s",{},[tag:"tt",{},[tag:"div",{},[tag:"b",{},[],text:"first"]]]]'
-       # firefox does this:
-       expected: 'tag:"b",{},[tag:"i",{},[tag:"a",{},[tag:"s",{},[tag:"tt",{},[]]]]],tag:"a",{},[tag:"s",{},[tag:"tt",{},[tag:"div",{},[tag:"b",{},[],text:"first"]]]],text:"second"'
-# tests from https://github.com/html5lib/html5lib-tests/blob/master/tree-construction/adoption01.dat
-test_parser name: "html5lib aaa 1", \
-       html: '<a><p></a></p>',
-       expected: 'tag:"a",{},[],tag:"p",{},[tag:"a",{},[]]'
-test_parser name: "html5lib aaa 2", \
-       html: '<a>1<p>2</a>3</p>',
-       expected: 'tag:"a",{},[text:"1"],tag:"p",{},[tag:"a",{},[text:"2"],text:"3"]'
-test_parser name: "html5lib aaa 3", \
-       html: '<a>1<button>2</a>3</button>',
-       expected: 'tag:"a",{},[text:"1"],tag:"button",{},[tag:"a",{},[text:"2"],text:"3"]'
-test_parser name: "html5lib aaa 4", \
-       html: '<a>1<b>2</a>3</b>',
-       expected: 'tag:"a",{},[text:"1",tag:"b",{},[text:"2"]],tag:"b",{},[text:"3"]'
-test_parser name: "html5lib aaa 5 (two divs deep)", \
-       html: '<a>1<div>2<div>3</a>4</div>5</div>',
-       expected: 'tag:"a",{},[text:"1"],tag:"div",{},[tag:"a",{},[text:"2"],tag:"div",{},[tag:"a",{},[text:"3"],text:"4"],text:"5"]'
-test_parser name: "html5lib aaa 6 (foster parenting)", \
-       html: '<table><a>1<p>2</a>3</p>',
-       expected: 'tag:"a",{},[text:"1"],tag:"p",{},[tag:"a",{},[text:"2"],text:"3"],tag:"table",{},[]'
-test_parser name: "html5lib aaa 7 (aaa, eof) 1", \
-       html: '<b><b><a><p></a>',
-       expected: 'tag:"b",{},[tag:"b",{},[tag:"a",{},[],tag:"p",{},[tag:"a",{},[]]]]'
-test_parser name: "html5lib aaa 8 (aaa, eof) 2", \
-       html: '<b><a><b><p></a>',
-       expected: 'tag:"b",{},[tag:"a",{},[tag:"b",{},[]],tag:"b",{},[tag:"p",{},[tag:"a",{},[]]]]'
-test_parser name: "html5lib aaa 9 (aaa, eof) 3", \
-       html: '<a><b><b><p></a>',
-       expected: 'tag:"a",{},[tag:"b",{},[tag:"b",{},[]]],tag:"b",{},[tag:"b",{},[tag:"p",{},[tag:"a",{},[]]]]'
-test_parser name: "html5lib aaa 10 (formatting, nesting, attrs, aaa)", \
-       html: '<p>1<s id="A">2<b id="B">3</p>4</s>5</b>',
-       expected: 'tag:"p",{},[text:"1",tag:"s",{"id":"A"},[text:"2",tag:"b",{"id":"B"},[text:"3"]]],tag:"s",{"id":"A"},[tag:"b",{"id":"B"},[text:"4"]],tag:"b",{"id":"B"},[text:"5"]'
-test_parser name: "html5lib aaa 11 (table with foster parenting, formatting el and td)", \
-       html: '<table><a>1<td>2</td>3</table>',
-       expected: 'tag:"a",{},[text:"1"],tag:"a",{},[text:"3"],tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[text:"2"]]]]'
-test_parser name: "html5lib aaa 12 (table with foster parenting, split text)", \
-       html: '<table>A<td>B</td>C</table>',
-       expected: 'text:"AC",tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[text:"B"]]]]'
-# TODO implement svg and namespacing
-#test_parser name: "html5lib aaa 13 (svg tr input)", \
-#      html: '<a><svg><tr><input></a>',
-#      expected: 'tag:"a",{},[svg:"svg",{},[svg:"tr",{},[svg:"input"]]]'
-test_parser name: "html5lib aaa 14 (deep ?outer aaa)", \
-       html: '<div><a><b><div><div><div><div><div><div><div><div><div><div></a>',
-       expected: 'tag:"div",{},[tag:"a",{},[tag:"b",{},[]],tag:"b",{},[tag:"div",{},[tag:"a",{},[],tag:"div",{},[tag:"a",{},[],tag:"div",{},[tag:"a",{},[],tag:"div",{},[tag:"a",{},[],tag:"div",{},[tag:"a",{},[],tag:"div",{},[tag:"a",{},[],tag:"div",{},[tag:"a",{},[],tag:"div",{},[tag:"a",{},[tag:"div",{},[tag:"div",{},[]]]]]]]]]]]]]'
-test_parser name: "html5lib aaa 15 (deep ?inner aaa)", \
-       html: '<div><a><b><u><i><code><div></a>',
-       expected: 'tag:"div",{},[tag:"a",{},[tag:"b",{},[tag:"u",{},[tag:"i",{},[tag:"code",{},[]]]]],tag:"u",{},[tag:"i",{},[tag:"code",{},[tag:"div",{},[tag:"a",{},[]]]]]]'
-test_parser name: "html5lib aaa 16 (correctly nested 4b)", \
-       html: '<b><b><b><b>x</b></b></b></b>y',
-       expected: 'tag:"b",{},[tag:"b",{},[tag:"b",{},[tag:"b",{},[text:"x"]]]],text:"y"'
-test_parser name: "html5lib aaa 17 (formatting, implied /p, noah's ark)", \
-       html: '<p><b><b><b><b><p>x',
-       expected: 'tag:"p",{},[tag:"b",{},[tag:"b",{},[tag:"b",{},[tag:"b",{},[]]]]],tag:"p",{},[tag:"b",{},[tag:"b",{},[tag:"b",{},[text:"x"]]]]'
-test_parser name: "variation on html5lib aaa 17 (with attributes in various orders)", \
-       html: '<p><b c="d" e="f"><b e="f" c="d"><b e="f" c="d"><b c="d" e="f"><p>x',
-       expected: 'tag:"p",{},[tag:"b",{"c":"d","e":"f"},[tag:"b",{"c":"d","e":"f"},[tag:"b",{"c":"d","e":"f"},[tag:"b",{"c":"d","e":"f"},[]]]]],tag:"p",{},[tag:"b",{"c":"d","e":"f"},[tag:"b",{"c":"d","e":"f"},[tag:"b",{"c":"d","e":"f"},[text:"x"]]]]'
-test_parser name: "junk after attribute close-quote", \
-       html: '<p><b c="d", e="f">foo<p>x',
-       expected: 'tag:"p",{},[tag:"b",{",":"","c":"d","e":"f"},[text:"foo"]],tag:"p",{},[tag:"b",{",":"","c":"d","e":"f"},[text:"x"]]'
-test_parser name: "html5lib aaa02 1", \
-       html: '<b>1<i>2<p>3</b>4',
-       expected: 'tag:"b",{},[text:"1",tag:"i",{},[text:"2"]],tag:"i",{},[tag:"p",{},[tag:"b",{},[text:"3"],text:"4"]]'
-test_parser name: "html5lib aaa02 2", \
-       html: '<a><div><style></style><address><a>',
-       expected: 'tag:"a",{},[],tag:"div",{},[tag:"a",{},[tag:"style",{},[]],tag:"address",{},[tag:"a",{},[],tag:"a",{},[]]]'
-test_parser name: "html5lib tables 1", \
-       html: '<table><th>',
-       expected: 'tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"th",{},[]]]]'
-test_parser name: "html5lib tables 2", \
-       html: '<table><td>',
-       expected: 'tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[]]]]'
-test_parser name: "html5lib tables 3", \
-       html: "<table><col foo='bar'>",
-       expected: 'tag:"table",{},[tag:"colgroup",{},[tag:"col",{"foo":"bar"},[]]]'
-test_parser name: "html5lib tables 4", \
-       html: '<table><colgroup></html>foo',
-       expected: 'text:"foo",tag:"table",{},[tag:"colgroup",{},[]]'
-test_parser name: "html5lib tables 5", \
-       html: '<table></table><p>foo',
-       expected: 'tag:"table",{},[],tag:"p",{},[text:"foo"]'
-test_parser name: "html5lib tables 6", \
-       html: '<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr><td>',
-       expected: 'tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[]]]]'
-test_parser name: "html5lib tables 7", \
-       html: '<table><select><option>3</select></table>',
-       expected: 'tag:"select",{},[tag:"option",{},[text:"3"]],tag:"table",{},[]'
-test_parser name: "html5lib tables 8", \
-       html: '<table><select><table></table></select></table>',
-       expected: 'tag:"select",{},[],tag:"table",{},[],tag:"table",{},[]'
-test_parser name: "html5lib tables 9", \
-       html: '<table><select></table>',
-       expected: 'tag:"select",{},[],tag:"table",{},[]'
-test_parser name: "html5lib tables 10", \
-       html: '<table><select><option>A<tr><td>B</td></tr></table>',
-       expected: 'tag:"select",{},[tag:"option",{},[text:"A"]],tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[text:"B"]]]]'
-test_parser name: "html5lib tables 11", \
-       html: '<table><td></body></caption></col></colgroup></html>foo',
-       expected: 'tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[text:"foo"]]]]'
-test_parser name: "html5lib tables 12", \
-       html: '<table><td>A</table>B',
-       expected: 'tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[text:"A"]]]],text:"B"'
-test_parser name: "html5lib tables 13", \
-       html: '<table><tr><caption>',
-       expected: 'tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[]],tag:"caption",{},[]]'
-test_parser name: "html5lib tables 14", \
-       html: '<table><tr></body></caption></col></colgroup></html></td></th><td>foo',
-       expected: 'tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[text:"foo"]]]]'
-test_parser name: "html5lib tables 15", \
-       html: '<table><td><tr>',
-       expected: 'tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[]],tag:"tr",{},[]]]'
-test_parser name: "html5lib tables 16", \
-       html: '<table><td><button><td>',
-       expected: 'tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[tag:"button",{},[]],tag:"td",{},[]]]]'
-# TODO implement svg parsing
-#test_parser name: "html5lib tables 17", \
-#      html: '<table><tr><td><svg><desc><td>',
-#      expected: 'tag:"table",{},[tag:"tbody",{},[tag:"tr",{},[tag:"td",{},[svg:"svg",{},[svg:"desc",{},[]]],tag:"td",{},[]]]]'
-test_summary()
+
+# TODO export TYPE_*
+module.exports.parse_html = parse_html
+module.exports.debug_log_reset = debug_log_reset
+module.exports.debug_log_each = debug_log_each
+module.exports.TYPE_TAG = TYPE_TAG
+module.exports.TYPE_TEXT = TYPE_TEXT
+module.exports.TYPE_COMMENT = TYPE_COMMENT
+module.exports.TYPE_DOCTYPE = TYPE_DOCTYPE
diff --git a/test.coffee b/test.coffee
new file mode 100644 (file)
index 0000000..1c45b68
--- /dev/null
@@ -0,0 +1,7858 @@
+# Copyright (c) 2006-2015 Jason Woofenden, James Graham, Geoffrey Sneddon, and
+# other contributors
+#
+# The values in the following data structure were extracted from the project at
+# https://github.com/html5lib/html5lib-tests which has the following notice:
+#
+# Copyright (c) 2006-2013 James Graham, Geoffrey Sneddon, and
+# other contributors
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# The rest of this file was written by Jason Woofenden in 2015, and is released
+# under the terms of the CC0 license:
+# http://creativecommons.org/publicdomain/zero/1.0/ and into the public domain
+
+tests = [
+       {
+               name: "adoption01.dat #1"
+               html: "<a><p></a></p>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <p>\n|       <a>\n"
+       }, {
+               name: "adoption01.dat #2"
+               html: "<a>1<p>2</a>3</p>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|     <p>\n|       <a>\n|         \"2\"\n|       \"3\"\n"
+       }, {
+               name: "adoption01.dat #3"
+               html: "<a>1<button>2</a>3</button>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|     <button>\n|       <a>\n|         \"2\"\n|       \"3\"\n"
+       }, {
+               name: "adoption01.dat #4"
+               html: "<a>1<b>2</a>3</b>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|       <b>\n|         \"2\"\n|     <b>\n|       \"3\"\n"
+       }, {
+               name: "adoption01.dat #5"
+               html: "<a>1<div>2<div>3</a>4</div>5</div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|     <div>\n|       <a>\n|         \"2\"\n|       <div>\n|         <a>\n|           \"3\"\n|         \"4\"\n|       \"5\"\n"
+       }, {
+               name: "adoption01.dat #6"
+               html: "<table><a>1<p>2</a>3</p>"
+               errors: 10
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|     <p>\n|       <a>\n|         \"2\"\n|       \"3\"\n|     <table>\n"
+       }, {
+               name: "adoption01.dat #7"
+               html: "<b><b><a><p></a>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <b>\n|         <a>\n|         <p>\n|           <a>\n"
+       }, {
+               name: "adoption01.dat #8"
+               html: "<b><a><b><p></a>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <a>\n|         <b>\n|       <b>\n|         <p>\n|           <a>\n"
+       }, {
+               name: "adoption01.dat #9"
+               html: "<a><b><b><p></a>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|         <b>\n|     <b>\n|       <b>\n|         <p>\n|           <a>\n"
+       }, {
+               name: "adoption01.dat #10"
+               html: "<p>1<s id=\"A\">2<b id=\"B\">3</p>4</s>5</b>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"1\"\n|       <s>\n|         id=\"A\"\n|         \"2\"\n|         <b>\n|           id=\"B\"\n|           \"3\"\n|     <s>\n|       id=\"A\"\n|       <b>\n|         id=\"B\"\n|         \"4\"\n|     <b>\n|       id=\"B\"\n|       \"5\"\n"
+       }, {
+               name: "adoption01.dat #11"
+               html: "<table><a>1<td>2</td>3</table>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|     <a>\n|       \"3\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"2\"\n"
+       }, {
+               name: "adoption01.dat #12"
+               html: "<table>A<td>B</td>C</table>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"AC\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"B\"\n"
+       }, {
+               name: "adoption01.dat #13"
+               html: "<a><svg><tr><input></a>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <svg svg>\n|         <svg tr>\n|           <svg input>\n"
+       }, {
+               name: "adoption01.dat #14"
+               html: "<div><a><b><div><div><div><div><div><div><div><div><div><div></a>"
+               errors: 10
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <a>\n|         <b>\n|       <b>\n|         <div>\n|           <a>\n|           <div>\n|             <a>\n|             <div>\n|               <a>\n|               <div>\n|                 <a>\n|                 <div>\n|                   <a>\n|                   <div>\n|                     <a>\n|                     <div>\n|                       <a>\n|                       <div>\n|                         <a>\n|                           <div>\n|                             <div>\n"
+       }, {
+               name: "adoption01.dat #15"
+               html: "<div><a><b><u><i><code><div></a>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <a>\n|         <b>\n|           <u>\n|             <i>\n|               <code>\n|       <u>\n|         <i>\n|           <code>\n|             <div>\n|               <a>\n"
+       }, {
+               name: "adoption01.dat #16"
+               html: "<b><b><b><b>x</b></b></b></b>y"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <b>\n|         <b>\n|           <b>\n|             \"x\"\n|     \"y\"\n"
+       }, {
+               name: "adoption01.dat #17"
+               html: "<p><b><b><b><b><p>x"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|         <b>\n|           <b>\n|             <b>\n|     <p>\n|       <b>\n|         <b>\n|           <b>\n|             \"x\"\n"
+       }, {
+               name: "adoption02.dat #1"
+               html: "<b>1<i>2<p>3</b>4"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"1\"\n|       <i>\n|         \"2\"\n|     <i>\n|       <p>\n|         <b>\n|           \"3\"\n|         \"4\"\n"
+       }, {
+               name: "adoption02.dat #2"
+               html: "<a><div><style></style><address><a>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <div>\n|       <a>\n|         <style>\n|       <address>\n|         <a>\n|         <a>\n"
+       }, {
+               name: "comments01.dat #1"
+               html: "FOO<!-- BAR -->BAZ"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR  -->\n|     \"BAZ\"\n"
+       }, {
+               name: "comments01.dat #2"
+               html: "FOO<!-- BAR --!>BAZ"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR  -->\n|     \"BAZ\"\n"
+       }, {
+               name: "comments01.dat #3"
+               html: "FOO<!-- BAR --   >BAZ"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR --   >BAZ -->\n"
+       }, {
+               name: "comments01.dat #4"
+               html: "FOO<!-- BAR -- <QUX> -- MUX -->BAZ"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR -- <QUX> -- MUX  -->\n|     \"BAZ\"\n"
+       }, {
+               name: "comments01.dat #5"
+               html: "FOO<!-- BAR -- <QUX> -- MUX --!>BAZ"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR -- <QUX> -- MUX  -->\n|     \"BAZ\"\n"
+       }, {
+               name: "comments01.dat #6"
+               html: "FOO<!-- BAR -- <QUX> -- MUX -- >BAZ"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR -- <QUX> -- MUX -- >BAZ -->\n"
+       }, {
+               name: "comments01.dat #7"
+               html: "FOO<!---->BAZ"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  -->\n|     \"BAZ\"\n"
+       }, {
+               name: "comments01.dat #8"
+               html: "FOO<!--->BAZ"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  -->\n|     \"BAZ\"\n"
+       }, {
+               name: "comments01.dat #9"
+               html: "FOO<!-->BAZ"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  -->\n|     \"BAZ\"\n"
+       }, {
+               name: "comments01.dat #10"
+               html: "<?xml version=\"1.0\">Hi"
+               errors: 2
+               expected: "| <!-- ?xml version=\"1.0\" -->\n| <html>\n|   <head>\n|   <body>\n|     \"Hi\"\n"
+       }, {
+               name: "comments01.dat #11"
+               html: "<?xml version=\"1.0\">"
+               errors: 2
+               expected: "| <!-- ?xml version=\"1.0\" -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "comments01.dat #12"
+               html: "<?xml version"
+               errors: 2
+               expected: "| <!-- ?xml version -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "comments01.dat #13"
+               html: "FOO<!----->BAZ"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!-- - -->\n|     \"BAZ\"\n"
+       }, {
+               name: "comments01.dat #14"
+               html: "<html><!-- comment --><title>Comment before head</title>"
+               errors: 1
+               expected: "| <html>\n|   <!--  comment  -->\n|   <head>\n|     <title>\n|       \"Comment before head\"\n|   <body>\n"
+       }, {
+               name: "doctype01.dat #1"
+               html: "<!DOCTYPE html>Hello"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #2"
+               html: "<!dOctYpE HtMl>Hello"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #3"
+               html: "<!DOCTYPEhtml>Hello"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #4"
+               html: "<!DOCTYPE>Hello"
+               errors: 3
+               expected: "| <!DOCTYPE >\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #5"
+               html: "<!DOCTYPE >Hello"
+               errors: 2
+               expected: "| <!DOCTYPE >\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #6"
+               html: "<!DOCTYPE potato>Hello"
+               errors: 1
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #7"
+               html: "<!DOCTYPE potato >Hello"
+               errors: 1
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #8"
+               html: "<!DOCTYPE potato taco>Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #9"
+               html: "<!DOCTYPE potato taco \"ddd>Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #10"
+               html: "<!DOCTYPE potato sYstEM>Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #11"
+               html: "<!DOCTYPE potato sYstEM    >Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #12"
+               html: "<!DOCTYPE   potato       sYstEM  ggg>Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #13"
+               html: "<!DOCTYPE potato SYSTEM taco  >Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #14"
+               html: "<!DOCTYPE potato SYSTEM 'taco\"'>Hello"
+               errors: 1
+               expected: "| <!DOCTYPE potato \"\" \"taco\"\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #15"
+               html: "<!DOCTYPE potato SYSTEM \"taco\">Hello"
+               errors: 1
+               expected: "| <!DOCTYPE potato \"\" \"taco\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #16"
+               html: "<!DOCTYPE potato SYSTEM \"tai'co\">Hello"
+               errors: 1
+               expected: "| <!DOCTYPE potato \"\" \"tai'co\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #17"
+               html: "<!DOCTYPE potato SYSTEMtaco \"ddd\">Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #18"
+               html: "<!DOCTYPE potato grass SYSTEM taco>Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #19"
+               html: "<!DOCTYPE potato pUbLIc>Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #20"
+               html: "<!DOCTYPE potato pUbLIc >Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #21"
+               html: "<!DOCTYPE potato pUbLIcgoof>Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #22"
+               html: "<!DOCTYPE potato PUBLIC goof>Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #23"
+               html: "<!DOCTYPE potato PUBLIC \"go'of\">Hello"
+               errors: 1
+               expected: "| <!DOCTYPE potato \"go'of\" \"\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #24"
+               html: "<!DOCTYPE potato PUBLIC 'go'of'>Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato \"go\" \"\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #25"
+               html: "<!DOCTYPE potato PUBLIC 'go:hh   of' >Hello"
+               errors: 1
+               expected: "| <!DOCTYPE potato \"go:hh   of\" \"\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #26"
+               html: "<!DOCTYPE potato PUBLIC \"W3C-//dfdf\" SYSTEM ggg>Hello"
+               errors: 2
+               expected: "| <!DOCTYPE potato \"W3C-//dfdf\" \"\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #27"
+               html: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n   \"http://www.w3.org/TR/html4/strict.dtd\">Hello"
+               expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #28"
+               html: "<!DOCTYPE ...>Hello"
+               errors: 1
+               expected: "| <!DOCTYPE ...>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
+       }, {
+               name: "doctype01.dat #29"
+               html: "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
+               errors: 1
+               expected: "| <!DOCTYPE html \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "doctype01.dat #30"
+               html: "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">"
+               errors: 1
+               expected: "| <!DOCTYPE html \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "doctype01.dat #31"
+               html: "<!DOCTYPE root-element [SYSTEM OR PUBLIC FPI] \"uri\" [ \n<!-- internal declarations -->\n]>"
+               errors: 2
+               expected: "| <!DOCTYPE root-element>\n| <html>\n|   <head>\n|   <body>\n|     \"]>\"\n"
+       }, {
+               name: "doctype01.dat #32"
+               html: "<!DOCTYPE html PUBLIC\n  \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\n    \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"
+               errors: 1
+               expected: "| <!DOCTYPE html \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "doctype01.dat #33"
+               html: "<!DOCTYPE HTML SYSTEM \"http://www.w3.org/DTD/HTML4-strict.dtd\"><body><b>Mine!</b></body>"
+               errors: 1
+               expected: "| <!DOCTYPE html \"\" \"http://www.w3.org/DTD/HTML4-strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"Mine!\"\n"
+       }, {
+               name: "doctype01.dat #34"
+               html: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">"
+               errors: 1
+               expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "doctype01.dat #35"
+               html: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"'http://www.w3.org/TR/html4/strict.dtd'>"
+               errors: 1
+               expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "doctype01.dat #36"
+               html: "<!DOCTYPE HTML PUBLIC\"-//W3C//DTD HTML 4.01//EN\"'http://www.w3.org/TR/html4/strict.dtd'>"
+               errors: 2
+               expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "doctype01.dat #37"
+               html: "<!DOCTYPE HTML PUBLIC'-//W3C//DTD HTML 4.01//EN''http://www.w3.org/TR/html4/strict.dtd'>"
+               errors: 2
+               expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #1"
+               html: "<svg><![CDATA[foo\nbar]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\nbar\"\n"
+       }, {
+               name: "domjs-unsafe.dat #2"
+               html: "<svg><![CDATA[foo\rbar]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\nbar\"\n"
+       }, {
+               name: "domjs-unsafe.dat #3"
+               html: "<svg><![CDATA[foo\r\nbar]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\nbar\"\n"
+       }, {
+               name: "domjs-unsafe.dat #4"
+               html: "<script>a='\u0000'</script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"a='�'\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #5"
+               html: "<script type=\"data\"><!--\u0000</script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--�\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #6"
+               html: "<script type=\"data\"><!--foo\u0000</script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--foo�\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #7"
+               html: "<script type=\"data\"><!-- foo-\u0000</script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo-�\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #8"
+               html: "<script type=\"data\"><!-- foo--\u0000</script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo--�\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #9"
+               html: "<script type=\"data\"><!-- foo-"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo-\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #10"
+               html: "<script type=\"data\"><!-- foo-<</script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo-<\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #11"
+               html: "<script type=\"data\"><!-- foo-<S"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo-<S\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #12"
+               html: "<script type=\"data\"><!-- foo-</SCRIPT>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo-\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #13"
+               html: "<script type=\"data\"><!--<p></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<p>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #14"
+               html: "<script type=\"data\"><!--<script></script></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script></script>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #15"
+               html: "<script type=\"data\"><!--<script>\u0000</script></script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script>�</script>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #16"
+               html: "<script type=\"data\"><!--<script>-\u0000</script></script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script>-�</script>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #17"
+               html: "<script type=\"data\"><!--<script>--\u0000</script></script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script>--�</script>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #18"
+               html: "<script type=\"data\"><!--<script>---</script></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script>---</script>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #19"
+               html: "<script type=\"data\"><!--<script></scrip></SCRIPT></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script></scrip></SCRIPT>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #20"
+               html: "<script type=\"data\"><!--<script></scrip </SCRIPT></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script></scrip </SCRIPT>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #21"
+               html: "<script type=\"data\"><!--<script></scrip/</SCRIPT></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script></scrip/</SCRIPT>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #22"
+               html: "<script type=\"data\"></scrip/></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"</scrip/>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #23"
+               html: "<script type=\"data\"></scrip ></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"</scrip >\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #24"
+               html: "<script type=\"data\"><!--</scrip></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--</scrip>\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #25"
+               html: "<script type=\"data\"><!--</scrip </script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--</scrip \"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #26"
+               html: "<script type=\"data\"><!--</scrip/</script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--</scrip/\"\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #27"
+               html: "<!DOCTYPE html><!DOCTYPE html>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #28"
+               html: "<html><!DOCTYPE html>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #29"
+               html: "<html><head><!DOCTYPE html></head>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #30"
+               html: "<html><head></head><!DOCTYPE html>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #31"
+               html: "<body></body><!DOCTYPE html>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #32"
+               html: "<table><!DOCTYPE html></table>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n"
+       }, {
+               name: "domjs-unsafe.dat #33"
+               html: "<select><!DOCTYPE html></select>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "domjs-unsafe.dat #34"
+               html: "<table><colgroup><!DOCTYPE html></colgroup></table>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n"
+       }, {
+               name: "domjs-unsafe.dat #35"
+               html: "<table><colgroup><!--test--></colgroup></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <!-- test -->\n"
+       }, {
+               name: "domjs-unsafe.dat #36"
+               html: "<table><colgroup><html></colgroup></table>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n"
+       }, {
+               name: "domjs-unsafe.dat #37"
+               html: "<table><colgroup> foo</colgroup></table>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"foo\"\n|     <table>\n|       <colgroup>\n|         \" \"\n"
+       }, {
+               name: "domjs-unsafe.dat #38"
+               html: "<select><!--test--></select>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <!-- test -->\n"
+       }, {
+               name: "domjs-unsafe.dat #39"
+               html: "<select><html></select>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "domjs-unsafe.dat #40"
+               html: "<frameset><html></frameset>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "domjs-unsafe.dat #41"
+               html: "<frameset></frameset><html>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "domjs-unsafe.dat #42"
+               html: "<frameset></frameset><!DOCTYPE html>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "domjs-unsafe.dat #43"
+               html: "<html><body></body></html><!DOCTYPE html>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "domjs-unsafe.dat #44"
+               html: "<svg><!DOCTYPE html></svg>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
+       }, {
+               name: "domjs-unsafe.dat #45"
+               html: "<svg><font></font></svg>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg font>\n"
+       }, {
+               name: "domjs-unsafe.dat #46"
+               html: "<svg><font id=foo></font></svg>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg font>\n|         id=\"foo\"\n"
+       }, {
+               name: "domjs-unsafe.dat #47"
+               html: "<svg><font size=4></font></svg>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <font>\n|       size=\"4\"\n"
+       }, {
+               name: "domjs-unsafe.dat #48"
+               html: "<svg><font color=red></font></svg>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <font>\n|       color=\"red\"\n"
+       }, {
+               name: "domjs-unsafe.dat #49"
+               html: "<svg><font font=sans></font></svg>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg font>\n|         font=\"sans\"\n"
+       }, {
+               name: "entities01.dat #1"
+               html: "FOO&gt;BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO>BAR\"\n"
+       }, {
+               name: "entities01.dat #2"
+               html: "FOO&gtBAR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO>BAR\"\n"
+       }, {
+               name: "entities01.dat #3"
+               html: "FOO&gt BAR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO> BAR\"\n"
+       }, {
+               name: "entities01.dat #4"
+               html: "FOO&gt;;;BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO>;;BAR\"\n"
+       }, {
+               name: "entities01.dat #5"
+               html: "I'm &notit; I tell you"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"I'm ¬it; I tell you\"\n"
+       }, {
+               name: "entities01.dat #6"
+               html: "I'm &notin; I tell you"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"I'm ∉ I tell you\"\n"
+       }, {
+               name: "entities01.dat #7"
+               html: "FOO& BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO& BAR\"\n"
+       }, {
+               name: "entities01.dat #8"
+               html: "FOO&<BAR>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&\"\n|     <bar>\n"
+       }, {
+               name: "entities01.dat #9"
+               html: "FOO&&&&gt;BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&&&>BAR\"\n"
+       }, {
+               name: "entities01.dat #10"
+               html: "FOO&#41;BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO)BAR\"\n"
+       }, {
+               name: "entities01.dat #11"
+               html: "FOO&#x41;BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOABAR\"\n"
+       }, {
+               name: "entities01.dat #12"
+               html: "FOO&#X41;BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOABAR\"\n"
+       }, {
+               name: "entities01.dat #13"
+               html: "FOO&#BAR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&#BAR\"\n"
+       }, {
+               name: "entities01.dat #14"
+               html: "FOO&#ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&#ZOO\"\n"
+       }, {
+               name: "entities01.dat #15"
+               html: "FOO&#xBAR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOºR\"\n"
+       }, {
+               name: "entities01.dat #16"
+               html: "FOO&#xZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&#xZOO\"\n"
+       }, {
+               name: "entities01.dat #17"
+               html: "FOO&#XZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&#XZOO\"\n"
+       }, {
+               name: "entities01.dat #18"
+               html: "FOO&#41BAR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO)BAR\"\n"
+       }, {
+               name: "entities01.dat #19"
+               html: "FOO&#x41BAR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO䆺R\"\n"
+       }, {
+               name: "entities01.dat #20"
+               html: "FOO&#x41ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOAZOO\"\n"
+       }, {
+               name: "entities01.dat #21"
+               html: "FOO&#x0000;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
+       }, {
+               name: "entities01.dat #22"
+               html: "FOO&#x0078;ZOO"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOxZOO\"\n"
+       }, {
+               name: "entities01.dat #23"
+               html: "FOO&#x0079;ZOO"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOyZOO\"\n"
+       }, {
+               name: "entities01.dat #24"
+               html: "FOO&#x0080;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO€ZOO\"\n"
+       }, {
+               name: "entities01.dat #25"
+               html: "FOO&#x0081;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\81ZOO\"\n"
+       }, {
+               name: "entities01.dat #26"
+               html: "FOO&#x0082;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO‚ZOO\"\n"
+       }, {
+               name: "entities01.dat #27"
+               html: "FOO&#x0083;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOƒZOO\"\n"
+       }, {
+               name: "entities01.dat #28"
+               html: "FOO&#x0084;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO„ZOO\"\n"
+       }, {
+               name: "entities01.dat #29"
+               html: "FOO&#x0085;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO…ZOO\"\n"
+       }, {
+               name: "entities01.dat #30"
+               html: "FOO&#x0086;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO†ZOO\"\n"
+       }, {
+               name: "entities01.dat #31"
+               html: "FOO&#x0087;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO‡ZOO\"\n"
+       }, {
+               name: "entities01.dat #32"
+               html: "FOO&#x0088;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOˆZOO\"\n"
+       }, {
+               name: "entities01.dat #33"
+               html: "FOO&#x0089;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO‰ZOO\"\n"
+       }, {
+               name: "entities01.dat #34"
+               html: "FOO&#x008A;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOŠZOO\"\n"
+       }, {
+               name: "entities01.dat #35"
+               html: "FOO&#x008B;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO‹ZOO\"\n"
+       }, {
+               name: "entities01.dat #36"
+               html: "FOO&#x008C;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOŒZOO\"\n"
+       }, {
+               name: "entities01.dat #37"
+               html: "FOO&#x008D;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\8dZOO\"\n"
+       }, {
+               name: "entities01.dat #38"
+               html: "FOO&#x008E;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOŽZOO\"\n"
+       }, {
+               name: "entities01.dat #39"
+               html: "FOO&#x008F;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\8fZOO\"\n"
+       }, {
+               name: "entities01.dat #40"
+               html: "FOO&#x0090;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\90ZOO\"\n"
+       }, {
+               name: "entities01.dat #41"
+               html: "FOO&#x0091;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO‘ZOO\"\n"
+       }, {
+               name: "entities01.dat #42"
+               html: "FOO&#x0092;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO’ZOO\"\n"
+       }, {
+               name: "entities01.dat #43"
+               html: "FOO&#x0093;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO“ZOO\"\n"
+       }, {
+               name: "entities01.dat #44"
+               html: "FOO&#x0094;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO”ZOO\"\n"
+       }, {
+               name: "entities01.dat #45"
+               html: "FOO&#x0095;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO•ZOO\"\n"
+       }, {
+               name: "entities01.dat #46"
+               html: "FOO&#x0096;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO–ZOO\"\n"
+       }, {
+               name: "entities01.dat #47"
+               html: "FOO&#x0097;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO—ZOO\"\n"
+       }, {
+               name: "entities01.dat #48"
+               html: "FOO&#x0098;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO˜ZOO\"\n"
+       }, {
+               name: "entities01.dat #49"
+               html: "FOO&#x0099;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO™ZOO\"\n"
+       }, {
+               name: "entities01.dat #50"
+               html: "FOO&#x009A;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOšZOO\"\n"
+       }, {
+               name: "entities01.dat #51"
+               html: "FOO&#x009B;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO›ZOO\"\n"
+       }, {
+               name: "entities01.dat #52"
+               html: "FOO&#x009C;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOœZOO\"\n"
+       }, {
+               name: "entities01.dat #53"
+               html: "FOO&#x009D;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\9dZOO\"\n"
+       }, {
+               name: "entities01.dat #54"
+               html: "FOO&#x009E;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOžZOO\"\n"
+       }, {
+               name: "entities01.dat #55"
+               html: "FOO&#x009F;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOŸZOO\"\n"
+       }, {
+               name: "entities01.dat #56"
+               html: "FOO&#x00A0;ZOO"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO ZOO\"\n"
+       }, {
+               name: "entities01.dat #57"
+               html: "FOO&#xD7FF;ZOO"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO퟿ZOO\"\n"
+       }, {
+               name: "entities01.dat #58"
+               html: "FOO&#xD800;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
+       }, {
+               name: "entities01.dat #59"
+               html: "FOO&#xD801;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
+       }, {
+               name: "entities01.dat #60"
+               html: "FOO&#xDFFE;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
+       }, {
+               name: "entities01.dat #61"
+               html: "FOO&#xDFFF;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
+       }, {
+               name: "entities01.dat #62"
+               html: "FOO&#xE000;ZOO"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOZOO\"\n"
+       }, {
+               name: "entities01.dat #63"
+               html: "FOO&#x10FFFE;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO􏿾ZOO\"\n"
+       }, {
+               name: "entities01.dat #64"
+               html: "FOO&#x1087D4;ZOO"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO􈟔ZOO\"\n"
+       }, {
+               name: "entities01.dat #65"
+               html: "FOO&#x10FFFF;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO􏿿ZOO\"\n"
+       }, {
+               name: "entities01.dat #66"
+               html: "FOO&#x110000;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
+       }, {
+               name: "entities01.dat #67"
+               html: "FOO&#xFFFFFF;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
+       }, {
+               name: "entities01.dat #68"
+               html: "FOO&#11111111111"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�\"\n"
+       }, {
+               name: "entities01.dat #69"
+               html: "FOO&#1111111111"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�\"\n"
+       }, {
+               name: "entities01.dat #70"
+               html: "FOO&#111111111111"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�\"\n"
+       }, {
+               name: "entities01.dat #71"
+               html: "FOO&#11111111111ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
+       }, {
+               name: "entities01.dat #72"
+               html: "FOO&#1111111111ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
+       }, {
+               name: "entities01.dat #73"
+               html: "FOO&#111111111111ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
+       }, {
+               name: "entities02.dat #1"
+               html: "<div bar=\"ZZ&gt;YY\"></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ>YY\"\n"
+       }, {
+               name: "entities02.dat #2"
+               html: "<div bar=\"ZZ&\"></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&\"\n"
+       }, {
+               name: "entities02.dat #3"
+               html: "<div bar='ZZ&'></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&\"\n"
+       }, {
+               name: "entities02.dat #4"
+               html: "<div bar=ZZ&></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&\"\n"
+       }, {
+               name: "entities02.dat #5"
+               html: "<div bar=\"ZZ&gt=YY\"></div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&gt=YY\"\n"
+       }, {
+               name: "entities02.dat #6"
+               html: "<div bar=\"ZZ&gt0YY\"></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&gt0YY\"\n"
+       }, {
+               name: "entities02.dat #7"
+               html: "<div bar=\"ZZ&gt9YY\"></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&gt9YY\"\n"
+       }, {
+               name: "entities02.dat #8"
+               html: "<div bar=\"ZZ&gtaYY\"></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&gtaYY\"\n"
+       }, {
+               name: "entities02.dat #9"
+               html: "<div bar=\"ZZ&gtZYY\"></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&gtZYY\"\n"
+       }, {
+               name: "entities02.dat #10"
+               html: "<div bar=\"ZZ&gt YY\"></div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ> YY\"\n"
+       }, {
+               name: "entities02.dat #11"
+               html: "<div bar=\"ZZ&gt\"></div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ>\"\n"
+       }, {
+               name: "entities02.dat #12"
+               html: "<div bar='ZZ&gt'></div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ>\"\n"
+       }, {
+               name: "entities02.dat #13"
+               html: "<div bar=ZZ&gt></div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ>\"\n"
+       }, {
+               name: "entities02.dat #14"
+               html: "<div bar=\"ZZ&pound_id=23\"></div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ£_id=23\"\n"
+       }, {
+               name: "entities02.dat #15"
+               html: "<div bar=\"ZZ&prod_id=23\"></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&prod_id=23\"\n"
+       }, {
+               name: "entities02.dat #16"
+               html: "<div bar=\"ZZ&pound;_id=23\"></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ£_id=23\"\n"
+       }, {
+               name: "entities02.dat #17"
+               html: "<div bar=\"ZZ&prod;_id=23\"></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ∏_id=23\"\n"
+       }, {
+               name: "entities02.dat #18"
+               html: "<div bar=\"ZZ&pound=23\"></div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&pound=23\"\n"
+       }, {
+               name: "entities02.dat #19"
+               html: "<div bar=\"ZZ&prod=23\"></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&prod=23\"\n"
+       }, {
+               name: "entities02.dat #20"
+               html: "<div>ZZ&pound_id=23</div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ£_id=23\"\n"
+       }, {
+               name: "entities02.dat #21"
+               html: "<div>ZZ&prod_id=23</div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ&prod_id=23\"\n"
+       }, {
+               name: "entities02.dat #22"
+               html: "<div>ZZ&pound;_id=23</div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ£_id=23\"\n"
+       }, {
+               name: "entities02.dat #23"
+               html: "<div>ZZ&prod;_id=23</div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ∏_id=23\"\n"
+       }, {
+               name: "entities02.dat #24"
+               html: "<div>ZZ&pound=23</div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ£=23\"\n"
+       }, {
+               name: "entities02.dat #25"
+               html: "<div>ZZ&prod=23</div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ&prod=23\"\n"
+       }, {
+               name: "entities02.dat #26"
+               html: "<div>ZZ&AElig=</div>"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZÆ=\"\n"
+       }, {
+               name: "foreign-fragment.dat #1"
+               html: "<nobr>X"
+               errors: 3,"document-fragment":"svg path"
+               expected: "| <svg nobr>\n|   \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #2"
+               html: "<font color></font>X"
+               errors: 1,"document-fragment":"svg path"
+               expected: "| <svg font>\n|   color=\"\"\n| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #3"
+               html: "<font></font>X"
+               fragment: "svg path"
+               expected: "| <svg font>\n| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #4"
+               html: "<g></path>X"
+               errors: 3,"document-fragment":"svg path"
+               expected: "| <svg g>\n|   \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #5"
+               html: "</path>X"
+               errors: 1,"document-fragment":"svg path"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #6"
+               html: "</foreignObject>X"
+               errors: 1,"document-fragment":"svg foreignObject"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #7"
+               html: "</desc>X"
+               errors: 1,"document-fragment":"svg desc"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #8"
+               html: "</title>X"
+               errors: 1,"document-fragment":"svg title"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #9"
+               html: "</svg>X"
+               errors: 1,"document-fragment":"svg svg"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #10"
+               html: "</mfenced>X"
+               errors: 1,"document-fragment":"math mfenced"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #11"
+               html: "</malignmark>X"
+               errors: 1,"document-fragment":"math malignmark"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #12"
+               html: "</math>X"
+               errors: 1,"document-fragment":"math math"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #13"
+               html: "</annotation-xml>X"
+               errors: 1,"document-fragment":"math annotation-xml"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #14"
+               html: "</mtext>X"
+               errors: 1,"document-fragment":"math mtext"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #15"
+               html: "</mi>X"
+               errors: 1,"document-fragment":"math mi"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #16"
+               html: "</mo>X"
+               errors: 1,"document-fragment":"math mo"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #17"
+               html: "</mn>X"
+               errors: 1,"document-fragment":"math mn"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #18"
+               html: "</ms>X"
+               errors: 1,"document-fragment":"math ms"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #19"
+               html: "<b></b><mglyph/><i></i><malignmark/><u></u><ms/>X"
+               errors: 3,"document-fragment":"math ms"
+               expected: "| <b>\n| <math mglyph>\n| <i>\n| <math malignmark>\n| <u>\n| <ms>\n|   \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #20"
+               html: "<malignmark></malignmark>"
+               fragment: "math ms"
+               expected: "| <math malignmark>\n"
+       }, {
+               name: "foreign-fragment.dat #21"
+               html: "<div></div>"
+               fragment: "math ms"
+               expected: "| <div>\n"
+       }, {
+               name: "foreign-fragment.dat #22"
+               html: "<figure></figure>"
+               fragment: "math ms"
+               expected: "| <figure>\n"
+       }, {
+               name: "foreign-fragment.dat #23"
+               html: "<b></b><mglyph/><i></i><malignmark/><u></u><mn/>X"
+               errors: 3,"document-fragment":"math mn"
+               expected: "| <b>\n| <math mglyph>\n| <i>\n| <math malignmark>\n| <u>\n| <mn>\n|   \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #24"
+               html: "<malignmark></malignmark>"
+               fragment: "math mn"
+               expected: "| <math malignmark>\n"
+       }, {
+               name: "foreign-fragment.dat #25"
+               html: "<div></div>"
+               fragment: "math mn"
+               expected: "| <div>\n"
+       }, {
+               name: "foreign-fragment.dat #26"
+               html: "<figure></figure>"
+               fragment: "math mn"
+               expected: "| <figure>\n"
+       }, {
+               name: "foreign-fragment.dat #27"
+               html: "<b></b><mglyph/><i></i><malignmark/><u></u><mo/>X"
+               errors: 3,"document-fragment":"math mo"
+               expected: "| <b>\n| <math mglyph>\n| <i>\n| <math malignmark>\n| <u>\n| <mo>\n|   \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #28"
+               html: "<malignmark></malignmark>"
+               fragment: "math mo"
+               expected: "| <math malignmark>\n"
+       }, {
+               name: "foreign-fragment.dat #29"
+               html: "<div></div>"
+               fragment: "math mo"
+               expected: "| <div>\n"
+       }, {
+               name: "foreign-fragment.dat #30"
+               html: "<figure></figure>"
+               fragment: "math mo"
+               expected: "| <figure>\n"
+       }, {
+               name: "foreign-fragment.dat #31"
+               html: "<b></b><mglyph/><i></i><malignmark/><u></u><mi/>X"
+               errors: 3,"document-fragment":"math mi"
+               expected: "| <b>\n| <math mglyph>\n| <i>\n| <math malignmark>\n| <u>\n| <mi>\n|   \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #32"
+               html: "<malignmark></malignmark>"
+               fragment: "math mi"
+               expected: "| <math malignmark>\n"
+       }, {
+               name: "foreign-fragment.dat #33"
+               html: "<div></div>"
+               fragment: "math mi"
+               expected: "| <div>\n"
+       }, {
+               name: "foreign-fragment.dat #34"
+               html: "<figure></figure>"
+               fragment: "math mi"
+               expected: "| <figure>\n"
+       }, {
+               name: "foreign-fragment.dat #35"
+               html: "<b></b><mglyph/><i></i><malignmark/><u></u><mtext/>X"
+               errors: 3,"document-fragment":"math mtext"
+               expected: "| <b>\n| <math mglyph>\n| <i>\n| <math malignmark>\n| <u>\n| <mtext>\n|   \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #36"
+               html: "<malignmark></malignmark>"
+               fragment: "math mtext"
+               expected: "| <math malignmark>\n"
+       }, {
+               name: "foreign-fragment.dat #37"
+               html: "<div></div>"
+               fragment: "math mtext"
+               expected: "| <div>\n"
+       }, {
+               name: "foreign-fragment.dat #38"
+               html: "<figure></figure>"
+               fragment: "math mtext"
+               expected: "| <figure>\n"
+       }, {
+               name: "foreign-fragment.dat #39"
+               html: "<div></div>"
+               errors: 1,"document-fragment":"math annotation-xml"
+               expected: "| <math div>\n"
+       }, {
+               name: "foreign-fragment.dat #40"
+               html: "<figure></figure>"
+               fragment: "math annotation-xml"
+               expected: "| <math figure>\n"
+       }, {
+               name: "foreign-fragment.dat #41"
+               html: "<div></div>"
+               errors: 1,"document-fragment":"math math"
+               expected: "| <math div>\n"
+       }, {
+               name: "foreign-fragment.dat #42"
+               html: "<figure></figure>"
+               fragment: "math math"
+               expected: "| <math figure>\n"
+       }, {
+               name: "foreign-fragment.dat #43"
+               html: "<div></div>"
+               fragment: "svg foreignObject"
+               expected: "| <div>\n"
+       }, {
+               name: "foreign-fragment.dat #44"
+               html: "<figure></figure>"
+               fragment: "svg foreignObject"
+               expected: "| <figure>\n"
+       }, {
+               name: "foreign-fragment.dat #45"
+               html: "<div></div>"
+               fragment: "svg title"
+               expected: "| <div>\n"
+       }, {
+               name: "foreign-fragment.dat #46"
+               html: "<figure></figure>"
+               fragment: "svg title"
+               expected: "| <figure>\n"
+       }, {
+               name: "foreign-fragment.dat #47"
+               html: "<figure></figure>"
+               fragment: "svg desc"
+               expected: "| <figure>\n"
+       }, {
+               name: "foreign-fragment.dat #48"
+               html: "<div><h1>X</h1></div>"
+               errors: 2,"document-fragment":"svg svg"
+               expected: "| <svg div>\n|   <svg h1>\n|     \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #49"
+               html: "<div></div>"
+               errors: 1,"document-fragment":"svg svg"
+               expected: "| <svg div>\n"
+       }, {
+               name: "foreign-fragment.dat #50"
+               html: "<div></div>"
+               fragment: "svg desc"
+               expected: "| <div>\n"
+       }, {
+               name: "foreign-fragment.dat #51"
+               html: "<figure></figure>"
+               fragment: "svg desc"
+               expected: "| <figure>\n"
+       }, {
+               name: "foreign-fragment.dat #52"
+               html: "<plaintext><foo>"
+               errors: 2,"document-fragment":"svg desc"
+               expected: "| <plaintext>\n|   \"<foo>\"\n"
+       }, {
+               name: "foreign-fragment.dat #53"
+               html: "<frameset>X"
+               errors: 1,"document-fragment":"svg desc"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #54"
+               html: "<head>X"
+               errors: 1,"document-fragment":"svg desc"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #55"
+               html: "<body>X"
+               errors: 1,"document-fragment":"svg desc"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #56"
+               html: "<html>X"
+               errors: 1,"document-fragment":"svg desc"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #57"
+               html: "<html class=\"foo\">X"
+               errors: 1,"document-fragment":"svg desc"
+               expected: "| \"X\"\n"
+       }, {
+               name: "foreign-fragment.dat #58"
+               html: "<body class=\"foo\">X"
+               errors: 1,"document-fragment":"svg desc"
+               expected: "| \"X\"\n"
+       }, {
+               name: "html5test-com.dat #1"
+               html: "<div<div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div<div>\n"
+       }, {
+               name: "html5test-com.dat #2"
+               html: "<div foo<bar=''>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       foo<bar=\"\"\n"
+       }, {
+               name: "html5test-com.dat #3"
+               html: "<div foo=`bar`>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       foo=\"`bar`\"\n"
+       }, {
+               name: "html5test-com.dat #4"
+               html: "<div \\\"foo=''>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \\\"foo=\"\"\n"
+       }, {
+               name: "html5test-com.dat #5"
+               html: "<a href='\\nbar'></a>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"\\nbar\"\n"
+       }, {
+               name: "html5test-com.dat #6"
+               html: "<!DOCTYPE html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "html5test-com.dat #7"
+               html: "&lang;&rang;"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"⟨⟩\"\n"
+       }, {
+               name: "html5test-com.dat #8"
+               html: "&apos;"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"'\"\n"
+       }, {
+               name: "html5test-com.dat #9"
+               html: "&ImaginaryI;"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"ⅈ\"\n"
+       }, {
+               name: "html5test-com.dat #10"
+               html: "&Kopf;"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"𝕂\"\n"
+       }, {
+               name: "html5test-com.dat #11"
+               html: "&notinva;"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"∉\"\n"
+       }, {
+               name: "html5test-com.dat #12"
+               html: "<?import namespace=\"foo\" implementation=\"#bar\">"
+               errors: 2
+               expected: "| <!-- ?import namespace=\"foo\" implementation=\"#bar\" -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "html5test-com.dat #13"
+               html: "<!--foo--bar-->"
+               errors: 2
+               expected: "| <!-- foo--bar -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "html5test-com.dat #14"
+               html: "<![CDATA[x]]>"
+               errors: 2
+               expected: "| <!-- [CDATA[x]] -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "html5test-com.dat #15"
+               html: "<textarea><!--</textarea>--></textarea>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<!--\"\n|     \"-->\"\n"
+       }, {
+               name: "html5test-com.dat #16"
+               html: "<textarea><!--</textarea>-->"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<!--\"\n|     \"-->\"\n"
+       }, {
+               name: "html5test-com.dat #17"
+               html: "<style><!--</style>--></style>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "html5test-com.dat #18"
+               html: "<style><!--</style>-->"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "html5test-com.dat #19"
+               html: "<ul><li>A </li> <li>B</li></ul>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ul>\n|       <li>\n|         \"A \"\n|       \" \"\n|       <li>\n|         \"B\"\n"
+       }, {
+               name: "html5test-com.dat #20"
+               html: "<table><form><input type=hidden><input></form><div></div></table>"
+               errors: 8
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <input>\n|     <div>\n|     <table>\n|       <form>\n|       <input>\n|         type=\"hidden\"\n"
+       }, {
+               name: "html5test-com.dat #21"
+               html: "<i>A<b>B<p></i>C</b>D"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"A\"\n|       <b>\n|         \"B\"\n|     <b>\n|     <p>\n|       <b>\n|         <i>\n|         \"C\"\n|       \"D\"\n"
+       }, {
+               name: "html5test-com.dat #22"
+               html: "<div></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n"
+       }, {
+               name: "html5test-com.dat #23"
+               html: "<svg></svg>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
+       }, {
+               name: "html5test-com.dat #24"
+               html: "<math></math>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n"
+       }, {
+               name: "inbody01.dat #1"
+               html: "<button>1</foo>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <button>\n|       \"1\"\n"
+       }, {
+               name: "inbody01.dat #2"
+               html: "<foo>1<p>2</foo>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       \"1\"\n|       <p>\n|         \"2\"\n"
+       }, {
+               name: "inbody01.dat #3"
+               html: "<dd>1</foo>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <dd>\n|       \"1\"\n"
+       }, {
+               name: "inbody01.dat #4"
+               html: "<foo>1<dd>2</foo>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       \"1\"\n|       <dd>\n|         \"2\"\n"
+       }, {
+               name: "isindex.dat #1"
+               html: "<isindex>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <hr>\n|       <label>\n|         \"This is a searchable index. Enter search keywords: \"\n|         <input>\n|           name=\"isindex\"\n|       <hr>\n"
+       }, {
+               name: "isindex.dat #2"
+               html: "<isindex name=\"A\" action=\"B\" prompt=\"C\" foo=\"D\">"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <form>\n|       action=\"B\"\n|       <hr>\n|       <label>\n|         \"C\"\n|         <input>\n|           foo=\"D\"\n|           name=\"isindex\"\n|       <hr>\n"
+       }, {
+               name: "isindex.dat #3"
+               html: "<form><isindex>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <form>\n"
+       }, {
+               name: "main-element.dat #1"
+               html: "<!doctype html><p>foo<main>bar<p>baz"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"foo\"\n|     <main>\n|       \"bar\"\n|       <p>\n|         \"baz\"\n"
+       }, {
+               name: "main-element.dat #2"
+               html: "<!doctype html><main><p>foo</main>bar"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <main>\n|       <p>\n|         \"foo\"\n|     \"bar\"\n"
+       }, {
+               name: "main-element.dat #3"
+               html: "<!DOCTYPE html>xxx<svg><x><g><a><main><b>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"xxx\"\n|     <svg svg>\n|       <svg x>\n|         <svg g>\n|           <svg a>\n|             <svg main>\n|     <b>\n"
+       }, {
+               name: "math.dat #1"
+               html: "<math><tr><td><mo><tr>"
+               fragment: "td"
+               expected: "| <math math>\n|   <math tr>\n|     <math td>\n|       <math mo>\n"
+       }, {
+               name: "math.dat #2"
+               html: "<math><tr><td><mo><tr>"
+               fragment: "tr"
+               expected: "| <math math>\n|   <math tr>\n|     <math td>\n|       <math mo>\n"
+       }, {
+               name: "math.dat #3"
+               html: "<math><thead><mo><tbody>"
+               fragment: "thead"
+               expected: "| <math math>\n|   <math thead>\n|     <math mo>\n"
+       }, {
+               name: "math.dat #4"
+               html: "<math><tfoot><mo><tbody>"
+               fragment: "tfoot"
+               expected: "| <math math>\n|   <math tfoot>\n|     <math mo>\n"
+       }, {
+               name: "math.dat #5"
+               html: "<math><tbody><mo><tfoot>"
+               fragment: "tbody"
+               expected: "| <math math>\n|   <math tbody>\n|     <math mo>\n"
+       }, {
+               name: "math.dat #6"
+               html: "<math><tbody><mo></table>"
+               fragment: "tbody"
+               expected: "| <math math>\n|   <math tbody>\n|     <math mo>\n"
+       }, {
+               name: "math.dat #7"
+               html: "<math><thead><mo></table>"
+               fragment: "tbody"
+               expected: "| <math math>\n|   <math thead>\n|     <math mo>\n"
+       }, {
+               name: "math.dat #8"
+               html: "<math><tfoot><mo></table>"
+               fragment: "tbody"
+               expected: "| <math math>\n|   <math tfoot>\n|     <math mo>\n"
+       }, {
+               name: "namespace-sensitivity.dat #1"
+               html: "<body><table><tr><td><svg><td><foreignObject><span></td>Foo"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"Foo\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg td>\n|                 <svg foreignObject>\n|                   <span>\n"
+       }, {
+               name: "pending-spec-changes.dat #1"
+               html: "<input type=\"hidden\"><frameset>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "pending-spec-changes.dat #2"
+               html: "<!DOCTYPE html><table><caption><svg>foo</table>bar"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <svg svg>\n|           \"foo\"\n|     \"bar\"\n"
+       }, {
+               name: "pending-spec-changes.dat #3"
+               html: "<table><tr><td><svg><desc><td></desc><circle>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg desc>\n|           <td>\n|             <circle>\n"
+       }, {
+               name: "pending-spec-changes-plain-text-unsafe.dat #1"
+               html: "<body><table>\u0000filler\u0000text\u0000"
+               errors: 18
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"fillertext\"\n|     <table>\n"
+       }, {
+               name: "plain-text-unsafe.dat #1"
+               html: "FOO&#x000D;ZOO"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\rZOO\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #2"
+               html: "<html>\u0000<frameset></frameset>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #3"
+               html: "<html> \u0000 <frameset></frameset>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #4"
+               html: "<html>a\u0000a<frameset></frameset>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"aa\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #5"
+               html: "<html>\u0000\u0000<frameset></frameset>"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #6"
+               html: "<html>\u0000\n <frameset></frameset>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #7"
+               html: "<html><select>\u0000"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "plain-text-unsafe.dat #8"
+               html: "\u0000"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "plain-text-unsafe.dat #9"
+               html: "<body>\u0000"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "plain-text-unsafe.dat #10"
+               html: "<plaintext>\u0000filler\u0000text\u0000"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"�filler�text�\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #11"
+               html: "<svg><![CDATA[\u0000filler\u0000text\u0000]]>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"�filler�text�\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #12"
+               html: "<body><!\u0000>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <!-- � -->\n"
+       }, {
+               name: "plain-text-unsafe.dat #13"
+               html: "<body><!\u0000filler\u0000text>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <!-- �filler�text -->\n"
+       }, {
+               name: "plain-text-unsafe.dat #14"
+               html: "<body><svg><foreignObject>\u0000filler\u0000text"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|         \"fillertext\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #15"
+               html: "<svg>\u0000filler\u0000text"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"�filler�text\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #16"
+               html: "<svg>\u0000<frameset>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"�\"\n|       <svg frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #17"
+               html: "<svg>\u0000 <frameset>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"� \"\n|       <svg frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #18"
+               html: "<svg>\u0000a<frameset>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"�a\"\n|       <svg frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #19"
+               html: "<svg>\u0000</svg><frameset>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #20"
+               html: "<svg>\u0000 </svg><frameset>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #21"
+               html: "<svg>\u0000a</svg><frameset>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"�a\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #22"
+               html: "<svg><path></path></svg><frameset>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #23"
+               html: "<svg><p><frameset>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "plain-text-unsafe.dat #24"
+               html: "<!DOCTYPE html><pre>\r\n\r\nA</pre>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"\nA\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #25"
+               html: "<!DOCTYPE html><pre>\r\rA</pre>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"\nA\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #26"
+               html: "<!DOCTYPE html><pre>\rA</pre>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"A\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #27"
+               html: "<!DOCTYPE html><table><tr><td><math><mtext>\u0000a"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <math math>\n|               <math mtext>\n|                 \"a\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #28"
+               html: "<!DOCTYPE html><table><tr><td><svg><foreignObject>\u0000a"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg foreignObject>\n|                 \"a\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #29"
+               html: "<!DOCTYPE html><math><mi>a\u0000b"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"ab\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #30"
+               html: "<!DOCTYPE html><math><mo>a\u0000b"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mo>\n|         \"ab\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #31"
+               html: "<!DOCTYPE html><math><mn>a\u0000b"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mn>\n|         \"ab\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #32"
+               html: "<!DOCTYPE html><math><ms>a\u0000b"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math ms>\n|         \"ab\"\n"
+       }, {
+               name: "plain-text-unsafe.dat #33"
+               html: "<!DOCTYPE html><math><mtext>a\u0000b"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mtext>\n|         \"ab\"\n"
+       }, {
+               name: "ruby.dat #1"
+               html: "<html><ruby>a<rb>b<rb></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|       <rb>\n"
+       }, {
+               name: "ruby.dat #2"
+               html: "<html><ruby>a<rb>b<rt></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|       <rt>\n"
+       }, {
+               name: "ruby.dat #3"
+               html: "<html><ruby>a<rb>b<rtc></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|       <rtc>\n"
+       }, {
+               name: "ruby.dat #4"
+               html: "<html><ruby>a<rb>b<rp></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|       <rp>\n"
+       }, {
+               name: "ruby.dat #5"
+               html: "<html><ruby>a<rb>b<span></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|         <span>\n"
+       }, {
+               name: "ruby.dat #6"
+               html: "<html><ruby>a<rt>b<rb></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|       <rb>\n"
+       }, {
+               name: "ruby.dat #7"
+               html: "<html><ruby>a<rt>b<rt></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|       <rt>\n"
+       }, {
+               name: "ruby.dat #8"
+               html: "<html><ruby>a<rt>b<rtc></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|       <rtc>\n"
+       }, {
+               name: "ruby.dat #9"
+               html: "<html><ruby>a<rt>b<rp></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|       <rp>\n"
+       }, {
+               name: "ruby.dat #10"
+               html: "<html><ruby>a<rt>b<span></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|         <span>\n"
+       }, {
+               name: "ruby.dat #11"
+               html: "<html><ruby>a<rtc>b<rb></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|       <rb>\n"
+       }, {
+               name: "ruby.dat #12"
+               html: "<html><ruby>a<rtc>b<rt>c<rt>d</ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|         <rt>\n|           \"c\"\n|         <rt>\n|           \"d\"\n"
+       }, {
+               name: "ruby.dat #13"
+               html: "<html><ruby>a<rtc>b<rtc></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|       <rtc>\n"
+       }, {
+               name: "ruby.dat #14"
+               html: "<html><ruby>a<rtc>b<rp></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|         <rp>\n"
+       }, {
+               name: "ruby.dat #15"
+               html: "<html><ruby>a<rtc>b<span></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|         <span>\n"
+       }, {
+               name: "ruby.dat #16"
+               html: "<html><ruby>a<rp>b<rb></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|       <rb>\n"
+       }, {
+               name: "ruby.dat #17"
+               html: "<html><ruby>a<rp>b<rt></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|       <rt>\n"
+       }, {
+               name: "ruby.dat #18"
+               html: "<html><ruby>a<rp>b<rtc></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|       <rtc>\n"
+       }, {
+               name: "ruby.dat #19"
+               html: "<html><ruby>a<rp>b<rp></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|       <rp>\n"
+       }, {
+               name: "ruby.dat #20"
+               html: "<html><ruby>a<rp>b<span></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|         <span>\n"
+       }, {
+               name: "ruby.dat #21"
+               html: "<html><ruby><rtc><ruby>a<rb>b<rt></ruby></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <rtc>\n|         <ruby>\n|           \"a\"\n|           <rb>\n|             \"b\"\n|           <rt>\n"
+       }, {
+               name: "scriptdata01.dat #1"
+               html: "FOO<script>'Hello'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'Hello'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #2"
+               html: "FOO<script></script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #3"
+               html: "FOO<script></script >BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #4"
+               html: "FOO<script></script/>BAR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #5"
+               html: "FOO<script></script/ >BAR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #6"
+               html: "FOO<script type=\"text/plain\"></scriptx>BAR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"</scriptx>BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #7"
+               html: "FOO<script></script foo=\">\" dd>BAR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #8"
+               html: "FOO<script>'<'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #9"
+               html: "FOO<script>'<!'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #10"
+               html: "FOO<script>'<!-'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #11"
+               html: "FOO<script>'<!--'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!--'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #12"
+               html: "FOO<script>'<!---'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!---'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #13"
+               html: "FOO<script>'<!-->'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-->'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #14"
+               html: "FOO<script>'<!-->'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-->'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #15"
+               html: "FOO<script>'<!-- potato'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-- potato'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #16"
+               html: "FOO<script>'<!-- <sCrIpt'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-- <sCrIpt'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #17"
+               html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt>'</script>BAR"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt>'</script>BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #18"
+               html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -'</script>BAR"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt> -'</script>BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #19"
+               html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --'</script>BAR"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt> --'</script>BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #20"
+               html: "FOO<script>'<!-- <sCrIpt> -->'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-- <sCrIpt> -->'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #21"
+               html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --!>'</script>BAR"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt> --!>'</script>BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #22"
+               html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -- >'</script>BAR"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt> -- >'</script>BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #23"
+               html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt '</script>BAR"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt '</script>BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #24"
+               html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt/'</script>BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #25"
+               html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt\\'</script>BAR"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt\\'\"\n|     \"BAR\"\n"
+       }, {
+               name: "scriptdata01.dat #26"
+               html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>QUX"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt/'</script>BAR\"\n|     \"QUX\"\n"
+       }, {
+               name: "scriptdata01.dat #27"
+               html: "FOO<script><!--<script>-></script>--></script>QUX"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"<!--<script>-></script>-->\"\n|     \"QUX\"\n"
+       }, {
+               name: "tables01.dat #1"
+               html: "<table><th>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <th>\n"
+       }, {
+               name: "tables01.dat #2"
+               html: "<table><td>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "tables01.dat #3"
+               html: "<table><col foo='bar'>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <col>\n|           foo=\"bar\"\n"
+       }, {
+               name: "tables01.dat #4"
+               html: "<table><colgroup></html>foo"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"foo\"\n|     <table>\n|       <colgroup>\n"
+       }, {
+               name: "tables01.dat #5"
+               html: "<table></table><p>foo"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|     <p>\n|       \"foo\"\n"
+       }, {
+               name: "tables01.dat #6"
+               html: "<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr><td>"
+               errors: 14
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "tables01.dat #7"
+               html: "<table><select><option>3</select></table>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|         \"3\"\n|     <table>\n"
+       }, {
+               name: "tables01.dat #8"
+               html: "<table><select><table></table></select></table>"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <table>\n|     <table>\n"
+       }, {
+               name: "tables01.dat #9"
+               html: "<table><select></table>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <table>\n"
+       }, {
+               name: "tables01.dat #10"
+               html: "<table><select><option>A<tr><td>B</td></tr></table>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|         \"A\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"B\"\n"
+       }, {
+               name: "tables01.dat #11"
+               html: "<table><td></body></caption></col></colgroup></html>foo"
+               errors: 8
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"foo\"\n"
+       }, {
+               name: "tables01.dat #12"
+               html: "<table><td>A</table>B"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"A\"\n|     \"B\"\n"
+       }, {
+               name: "tables01.dat #13"
+               html: "<table><tr><caption>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|       <caption>\n"
+       }, {
+               name: "tables01.dat #14"
+               html: "<table><tr></body></caption></col></colgroup></html></td></th><td>foo"
+               errors: 9
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"foo\"\n"
+       }, {
+               name: "tables01.dat #15"
+               html: "<table><td><tr>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|         <tr>\n"
+       }, {
+               name: "tables01.dat #16"
+               html: "<table><td><button><td>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <button>\n|           <td>\n"
+       }, {
+               name: "tables01.dat #17"
+               html: "<table><tr><td><svg><desc><td>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg desc>\n|           <td>\n"
+       }, {
+               name: "template.dat #1"
+               html: "<body><template>Hello</template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         \"Hello\"\n"
+       }, {
+               name: "template.dat #2"
+               html: "<template>Hello</template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         \"Hello\"\n|   <body>\n"
+       }, {
+               name: "template.dat #3"
+               html: "<template></template><div></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|   <body>\n|     <div>\n"
+       }, {
+               name: "template.dat #4"
+               html: "<html><template>Hello</template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         \"Hello\"\n|   <body>\n"
+       }, {
+               name: "template.dat #5"
+               html: "<head><template><div></div></template></head>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <div>\n|   <body>\n"
+       }, {
+               name: "template.dat #6"
+               html: "<div><template><div><span></template><b>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <template>\n|         content\n|           <div>\n|             <span>\n|       <b>\n"
+       }, {
+               name: "template.dat #7"
+               html: "<div><template></div>Hello"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <template>\n|         content\n|           \"Hello\"\n"
+       }, {
+               name: "template.dat #8"
+               html: "<div></template></div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n"
+       }, {
+               name: "template.dat #9"
+               html: "<table><template></template></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n"
+       }, {
+               name: "template.dat #10"
+               html: "<table><template></template></div>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n"
+       }, {
+               name: "template.dat #11"
+               html: "<table><div><template></template></div>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <template>\n|         content\n|     <table>\n"
+       }, {
+               name: "template.dat #12"
+               html: "<table><template></template><div></div>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|     <table>\n|       <template>\n|         content\n"
+       }, {
+               name: "template.dat #13"
+               html: "<table>   <template></template></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       \"   \"\n|       <template>\n|         content\n"
+       }, {
+               name: "template.dat #14"
+               html: "<table><tbody><template></template></tbody>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <template>\n|           content\n"
+       }, {
+               name: "template.dat #15"
+               html: "<table><tbody><template></tbody></template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <template>\n|           content\n"
+       }, {
+               name: "template.dat #16"
+               html: "<table><tbody><template></template></tbody></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <template>\n|           content\n"
+       }, {
+               name: "template.dat #17"
+               html: "<table><thead><template></template></thead>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <thead>\n|         <template>\n|           content\n"
+       }, {
+               name: "template.dat #18"
+               html: "<table><tfoot><template></template></tfoot>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tfoot>\n|         <template>\n|           content\n"
+       }, {
+               name: "template.dat #19"
+               html: "<select><template></template></select>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <template>\n|         content\n"
+       }, {
+               name: "template.dat #20"
+               html: "<select><template><option></option></template></select>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <template>\n|         content\n|           <option>\n"
+       }, {
+               name: "template.dat #21"
+               html: "<template><option></option></select><option></option></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <option>\n|         <option>\n|   <body>\n"
+       }, {
+               name: "template.dat #22"
+               html: "<select><template></template><option></select>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <template>\n|         content\n|       <option>\n"
+       }, {
+               name: "template.dat #23"
+               html: "<select><option><template></template></select>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|         <template>\n|           content\n"
+       }, {
+               name: "template.dat #24"
+               html: "<select><template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <template>\n|         content\n"
+       }, {
+               name: "template.dat #25"
+               html: "<select><option></option><template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|       <template>\n|         content\n"
+       }, {
+               name: "template.dat #26"
+               html: "<select><option></option><template><option>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|       <template>\n|         content\n|           <option>\n"
+       }, {
+               name: "template.dat #27"
+               html: "<table><thead><template><td></template></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <thead>\n|         <template>\n|           content\n|             <td>\n"
+       }, {
+               name: "template.dat #28"
+               html: "<table><template><thead></template></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <thead>\n"
+       }, {
+               name: "template.dat #29"
+               html: "<body><table><template><td></tr><div></template></table>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <td>\n|             <div>\n"
+       }, {
+               name: "template.dat #30"
+               html: "<table><template><thead></template></thead></table>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <thead>\n"
+       }, {
+               name: "template.dat #31"
+               html: "<table><thead><template><tr></template></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <thead>\n|         <template>\n|           content\n|             <tr>\n"
+       }, {
+               name: "template.dat #32"
+               html: "<table><template><tr></template></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <tr>\n"
+       }, {
+               name: "template.dat #33"
+               html: "<table><tr><template><td>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <template>\n|             content\n|               <td>\n"
+       }, {
+               name: "template.dat #34"
+               html: "<table><template><tr><template><td></template></tr></template></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <tr>\n|             <template>\n|               content\n|                 <td>\n"
+       }, {
+               name: "template.dat #35"
+               html: "<table><template><tr><template><td></td></template></tr></template></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <tr>\n|             <template>\n|               content\n|                 <td>\n"
+       }, {
+               name: "template.dat #36"
+               html: "<table><template><td></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <td>\n"
+       }, {
+               name: "template.dat #37"
+               html: "<body><template><td></td></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n"
+       }, {
+               name: "template.dat #38"
+               html: "<body><template><template><tr></tr></template><td></td></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <tr>\n|         <td>\n"
+       }, {
+               name: "template.dat #39"
+               html: "<table><colgroup><template><col>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <template>\n|           content\n|             <col>\n"
+       }, {
+               name: "template.dat #40"
+               html: "<frameset><template><frame></frame></template></frameset>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
+       }, {
+               name: "template.dat #41"
+               html: "<template><frame></frame></frameset><frame></frame></template>"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|   <body>\n"
+       }, {
+               name: "template.dat #42"
+               html: "<template><div><frameset><span></span></div><span></span></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <div>\n|           <span>\n|         <span>\n|   <body>\n"
+       }, {
+               name: "template.dat #43"
+               html: "<body><template><div><frameset><span></span></div><span></span></template></body>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <div>\n|           <span>\n|         <span>\n"
+       }, {
+               name: "template.dat #44"
+               html: "<body><template><script>var i = 1;</script><td></td></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <script>\n|           \"var i = 1;\"\n|         <td>\n"
+       }, {
+               name: "template.dat #45"
+               html: "<body><template><tr><div></div></tr></template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <div>\n"
+       }, {
+               name: "template.dat #46"
+               html: "<body><template><tr></tr><td></td></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "template.dat #47"
+               html: "<body><template><td></td></tr><td></td></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n|         <td>\n"
+       }, {
+               name: "template.dat #48"
+               html: "<body><template><td></td><tbody><td></td></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n|         <td>\n"
+       }, {
+               name: "template.dat #49"
+               html: "<body><template><td></td><caption></caption><td></td></template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n|         <td>\n"
+       }, {
+               name: "template.dat #50"
+               html: "<body><template><td></td><colgroup></caption><td></td></template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n|         <td>\n"
+       }, {
+               name: "template.dat #51"
+               html: "<body><template><td></td></table><td></td></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n|         <td>\n"
+       }, {
+               name: "template.dat #52"
+               html: "<body><template><tr></tr><tbody><tr></tr></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <tr>\n"
+       }, {
+               name: "template.dat #53"
+               html: "<body><template><tr></tr><caption><tr></tr></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <tr>\n"
+       }, {
+               name: "template.dat #54"
+               html: "<body><template><tr></tr></table><tr></tr></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <tr>\n"
+       }, {
+               name: "template.dat #55"
+               html: "<body><template><thead></thead><caption></caption><tbody></tbody></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <thead>\n|         <caption>\n|         <tbody>\n"
+       }, {
+               name: "template.dat #56"
+               html: "<body><template><thead></thead></table><tbody></tbody></template></body>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <thead>\n|         <tbody>\n"
+       }, {
+               name: "template.dat #57"
+               html: "<body><template><div><tr></tr></div></template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <div>\n"
+       }, {
+               name: "template.dat #58"
+               html: "<body><template><em>Hello</em></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <em>\n|           \"Hello\"\n"
+       }, {
+               name: "template.dat #59"
+               html: "<body><template><!--comment--></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <!-- comment -->\n"
+       }, {
+               name: "template.dat #60"
+               html: "<body><template><style></style><td></td></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <style>\n|         <td>\n"
+       }, {
+               name: "template.dat #61"
+               html: "<body><template><meta><td></td></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <meta>\n|         <td>\n"
+       }, {
+               name: "template.dat #62"
+               html: "<body><template><link><td></td></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <link>\n|         <td>\n"
+       }, {
+               name: "template.dat #63"
+               html: "<body><template><template><tr></tr></template><td></td></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <tr>\n|         <td>\n"
+       }, {
+               name: "template.dat #64"
+               html: "<body><table><colgroup><template><col></col></template></colgroup></table></body>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <template>\n|           content\n|             <col>\n"
+       }, {
+               name: "template.dat #65"
+               html: "<body a=b><template><div></div><body c=d><div></div></body></template></body>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     a=\"b\"\n|     <template>\n|       content\n|         <div>\n|         <div>\n"
+       }, {
+               name: "template.dat #66"
+               html: "<html a=b><template><div><html b=c><span></template>"
+               errors: 3
+               expected: "| <html>\n|   a=\"b\"\n|   <head>\n|     <template>\n|       content\n|         <div>\n|           <span>\n|   <body>\n"
+       }, {
+               name: "template.dat #67"
+               html: "<html a=b><template><col></col><html b=c><col></col></template>"
+               errors: 4
+               expected: "| <html>\n|   a=\"b\"\n|   <head>\n|     <template>\n|       content\n|         <col>\n|         <col>\n|   <body>\n"
+       }, {
+               name: "template.dat #68"
+               html: "<html a=b><template><frame></frame><html b=c><frame></frame></template>"
+               errors: 6
+               expected: "| <html>\n|   a=\"b\"\n|   <head>\n|     <template>\n|       content\n|   <body>\n"
+       }, {
+               name: "template.dat #69"
+               html: "<body><template><tr></tr><template></template><td></td></template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <template>\n|           content\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "template.dat #70"
+               html: "<body><template><thead></thead><template><tr></tr></template><tr></tr><tfoot></tfoot></template>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <thead>\n|         <template>\n|           content\n|             <tr>\n|         <tbody>\n|           <tr>\n|         <tfoot>\n"
+       }, {
+               name: "template.dat #71"
+               html: "<body><template><template><b><template></template></template>text</template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <b>\n|               <template>\n|                 content\n|         \"text\"\n"
+       }, {
+               name: "template.dat #72"
+               html: "<body><template><col><colgroup>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
+       }, {
+               name: "template.dat #73"
+               html: "<body><template><col></colgroup>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
+       }, {
+               name: "template.dat #74"
+               html: "<body><template><col><colgroup></template></body>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
+       }, {
+               name: "template.dat #75"
+               html: "<body><template><col><div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
+       }, {
+               name: "template.dat #76"
+               html: "<body><template><col></div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
+       }, {
+               name: "template.dat #77"
+               html: "<body><template><col>Hello"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
+       }, {
+               name: "template.dat #78"
+               html: "<body><template><i><menu>Foo</i>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <i>\n|         <menu>\n|           <i>\n|             \"Foo\"\n"
+       }, {
+               name: "template.dat #79"
+               html: "<body><template></div><div>Foo</div><template></template><tr></tr>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <div>\n|           \"Foo\"\n|         <template>\n|           content\n"
+       }, {
+               name: "template.dat #80"
+               html: "<body><div><template></div><tr><td>Foo</td></tr></template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <template>\n|         content\n|           <tr>\n|             <td>\n|               \"Foo\"\n"
+       }, {
+               name: "template.dat #81"
+               html: "<template></figcaption><sub><table></table>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <sub>\n|           <table>\n|   <body>\n"
+       }, {
+               name: "template.dat #82"
+               html: "<template><template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|   <body>\n"
+       }, {
+               name: "template.dat #83"
+               html: "<template><div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <div>\n|   <body>\n"
+       }, {
+               name: "template.dat #84"
+               html: "<template><template><div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <div>\n|   <body>\n"
+       }, {
+               name: "template.dat #85"
+               html: "<template><template><table>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <table>\n|   <body>\n"
+       }, {
+               name: "template.dat #86"
+               html: "<template><template><tbody>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <tbody>\n|   <body>\n"
+       }, {
+               name: "template.dat #87"
+               html: "<template><template><tr>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <tr>\n|   <body>\n"
+       }, {
+               name: "template.dat #88"
+               html: "<template><template><td>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <td>\n|   <body>\n"
+       }, {
+               name: "template.dat #89"
+               html: "<template><template><caption>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <caption>\n|   <body>\n"
+       }, {
+               name: "template.dat #90"
+               html: "<template><template><colgroup>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <colgroup>\n|   <body>\n"
+       }, {
+               name: "template.dat #91"
+               html: "<template><template><col>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <col>\n|   <body>\n"
+       }, {
+               name: "template.dat #92"
+               html: "<template><template><tbody><select>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <tbody>\n|             <select>\n|   <body>\n"
+       }, {
+               name: "template.dat #93"
+               html: "<template><template><table>Foo"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             \"Foo\"\n|             <table>\n|   <body>\n"
+       }, {
+               name: "template.dat #94"
+               html: "<template><template><frame>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|   <body>\n"
+       }, {
+               name: "template.dat #95"
+               html: "<template><template><script>var i"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <script>\n|               \"var i\"\n|   <body>\n"
+       }, {
+               name: "template.dat #96"
+               html: "<template><template><style>var i"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <style>\n|               \"var i\"\n|   <body>\n"
+       }, {
+               name: "template.dat #97"
+               html: "<template><table></template><body><span>Foo"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <table>\n|   <body>\n|     <span>\n|       \"Foo\"\n"
+       }, {
+               name: "template.dat #98"
+               html: "<template><td></template><body><span>Foo"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <td>\n|   <body>\n|     <span>\n|       \"Foo\"\n"
+       }, {
+               name: "template.dat #99"
+               html: "<template><object></template><body><span>Foo"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <object>\n|   <body>\n|     <span>\n|       \"Foo\"\n"
+       }, {
+               name: "template.dat #100"
+               html: "<template><svg><template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <svg svg>\n|           <svg template>\n|   <body>\n"
+       }, {
+               name: "template.dat #101"
+               html: "<template><svg><foo><template><foreignObject><div></template><div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <svg svg>\n|           <svg foo>\n|             <svg template>\n|               <svg foreignObject>\n|                 <div>\n|   <body>\n|     <div>\n"
+       }, {
+               name: "template.dat #102"
+               html: "<dummy><template><span></dummy>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <dummy>\n|       <template>\n|         content\n|           <span>\n"
+       }, {
+               name: "template.dat #103"
+               html: "<body><table><tr><td><select><template>Foo</template><caption>A</table>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <select>\n|               <template>\n|                 content\n|                   \"Foo\"\n|       <caption>\n|         \"A\"\n"
+       }, {
+               name: "template.dat #104"
+               html: "<body></body><template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n"
+       }, {
+               name: "template.dat #105"
+               html: "<head></head><template>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|   <body>\n"
+       }, {
+               name: "template.dat #106"
+               html: "<head></head><template>Foo</template>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         \"Foo\"\n|   <body>\n"
+       }, {
+               name: "template.dat #107"
+               html: "<!DOCTYPE HTML><dummy><table><template><table><template><table><script>"
+               errors: 4
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <dummy>\n|       <table>\n|         <template>\n|           content\n|             <table>\n|               <template>\n|                 content\n|                   <table>\n|                     <script>\n"
+       }, {
+               name: "template.dat #108"
+               html: "<template><a><table><a>"
+               expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <a>\n|           <a>\n|           <table>\n|   <body>"
+       }, {
+               name: "tests10.dat #1"
+               html: "<!DOCTYPE html><svg></svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
+       }, {
+               name: "tests10.dat #2"
+               html: "<!DOCTYPE html><svg></svg><![CDATA[a]]>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <!-- [CDATA[a]] -->\n"
+       }, {
+               name: "tests10.dat #3"
+               html: "<!DOCTYPE html><body><svg></svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
+       }, {
+               name: "tests10.dat #4"
+               html: "<!DOCTYPE html><body><select><svg></svg></select>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "tests10.dat #5"
+               html: "<!DOCTYPE html><body><select><option><svg></svg></option></select>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n"
+       }, {
+               name: "tests10.dat #6"
+               html: "<!DOCTYPE html><body><table><svg></svg></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <table>\n"
+       }, {
+               name: "tests10.dat #7"
+               html: "<!DOCTYPE html><body><table><svg><g>foo</g></svg></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|     <table>\n"
+       }, {
+               name: "tests10.dat #8"
+               html: "<!DOCTYPE html><body><table><svg><g>foo</g><g>bar</g></svg></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <table>\n"
+       }, {
+               name: "tests10.dat #9"
+               html: "<!DOCTYPE html><body><table><tbody><svg><g>foo</g><g>bar</g></svg></tbody></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <table>\n|       <tbody>\n"
+       }, {
+               name: "tests10.dat #10"
+               html: "<!DOCTYPE html><body><table><tbody><tr><svg><g>foo</g><g>bar</g></svg></tr></tbody></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests10.dat #11"
+               html: "<!DOCTYPE html><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg></td></tr></tbody></table>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg g>\n|                 \"foo\"\n|               <svg g>\n|                 \"bar\"\n"
+       }, {
+               name: "tests10.dat #12"
+               html: "<!DOCTYPE html><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg><p>baz</td></tr></tbody></table>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg g>\n|                 \"foo\"\n|               <svg g>\n|                 \"bar\"\n|             <p>\n|               \"baz\"\n"
+       }, {
+               name: "tests10.dat #13"
+               html: "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</caption></table>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <svg svg>\n|           <svg g>\n|             \"foo\"\n|           <svg g>\n|             \"bar\"\n|         <p>\n|           \"baz\"\n"
+       }, {
+               name: "tests10.dat #14"
+               html: "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g><p>baz</table><p>quux"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <svg svg>\n|           <svg g>\n|             \"foo\"\n|           <svg g>\n|             \"bar\"\n|         <p>\n|           \"baz\"\n|     <p>\n|       \"quux\"\n"
+       }, {
+               name: "tests10.dat #15"
+               html: "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g>baz</table><p>quux"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <svg svg>\n|           <svg g>\n|             \"foo\"\n|           <svg g>\n|             \"bar\"\n|           \"baz\"\n|     <p>\n|       \"quux\"\n"
+       }, {
+               name: "tests10.dat #16"
+               html: "<!DOCTYPE html><body><table><colgroup><svg><g>foo</g><g>bar</g><p>baz</table><p>quux"
+               errors: 6
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n|     <table>\n|       <colgroup>\n|     <p>\n|       \"quux\"\n"
+       }, {
+               name: "tests10.dat #17"
+               html: "<!DOCTYPE html><body><table><tr><td><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux"
+               errors: 7
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <select>\n|               \"foobarbaz\"\n|     <p>\n|       \"quux\"\n"
+       }, {
+               name: "tests10.dat #18"
+               html: "<!DOCTYPE html><body><table><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux"
+               errors: 8
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       \"foobarbaz\"\n|     <table>\n|     <p>\n|       \"quux\"\n"
+       }, {
+               name: "tests10.dat #19"
+               html: "<!DOCTYPE html><body></body></html><svg><g>foo</g><g>bar</g><p>baz"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n"
+       }, {
+               name: "tests10.dat #20"
+               html: "<!DOCTYPE html><body></body><svg><g>foo</g><g>bar</g><p>baz"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n"
+       }, {
+               name: "tests10.dat #21"
+               html: "<!DOCTYPE html><frameset><svg><g></g><g></g><p><span>"
+               errors: 8
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests10.dat #22"
+               html: "<!DOCTYPE html><frameset></frameset><svg><g></g><g></g><p><span>"
+               errors: 7
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests10.dat #23"
+               html: "<!DOCTYPE html><body xlink:href=foo><svg xlink:href=foo></svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     <svg svg>\n|       xlink href=\"foo\"\n"
+       }, {
+               name: "tests10.dat #24"
+               html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo></g></svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <svg svg>\n|       <svg g>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n"
+       }, {
+               name: "tests10.dat #25"
+               html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo /></svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <svg svg>\n|       <svg g>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n"
+       }, {
+               name: "tests10.dat #26"
+               html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo />bar</svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <svg svg>\n|       <svg g>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n|       \"bar\"\n"
+       }, {
+               name: "tests10.dat #27"
+               html: "<svg></path>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
+       }, {
+               name: "tests10.dat #28"
+               html: "<div><svg></div>a"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|     \"a\"\n"
+       }, {
+               name: "tests10.dat #29"
+               html: "<div><svg><path></div>a"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|         <svg path>\n|     \"a\"\n"
+       }, {
+               name: "tests10.dat #30"
+               html: "<div><svg><path></svg><path>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|         <svg path>\n|       <path>\n"
+       }, {
+               name: "tests10.dat #31"
+               html: "<div><svg><path><foreignObject><math></div>a"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|         <svg path>\n|           <svg foreignObject>\n|             <math math>\n|               \"a\"\n"
+       }, {
+               name: "tests10.dat #32"
+               html: "<div><svg><path><foreignObject><p></div>a"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|         <svg path>\n|           <svg foreignObject>\n|             <p>\n|               \"a\"\n"
+       }, {
+               name: "tests10.dat #33"
+               html: "<!DOCTYPE html><svg><desc><div><svg><ul>a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg desc>\n|         <div>\n|           <svg svg>\n|           <ul>\n|             \"a\"\n"
+       }, {
+               name: "tests10.dat #34"
+               html: "<!DOCTYPE html><svg><desc><svg><ul>a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg desc>\n|         <svg svg>\n|         <ul>\n|           \"a\"\n"
+       }, {
+               name: "tests10.dat #35"
+               html: "<!DOCTYPE html><p><svg><desc><p>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <svg svg>\n|         <svg desc>\n|           <p>\n"
+       }, {
+               name: "tests10.dat #36"
+               html: "<!DOCTYPE html><p><svg><title><p>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <svg svg>\n|         <svg title>\n|           <p>\n"
+       }, {
+               name: "tests10.dat #37"
+               html: "<div><svg><path><foreignObject><p></foreignObject><p>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|         <svg path>\n|           <svg foreignObject>\n|             <p>\n|             <p>\n"
+       }, {
+               name: "tests10.dat #38"
+               html: "<math><mi><div><object><div><span></span></div></object></div></mi><mi>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         <div>\n|           <object>\n|             <div>\n|               <span>\n|       <math mi>\n"
+       }, {
+               name: "tests10.dat #39"
+               html: "<math><mi><svg><foreignObject><div><div></div></div></foreignObject></svg></mi><mi>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         <svg svg>\n|           <svg foreignObject>\n|             <div>\n|               <div>\n|       <math mi>\n"
+       }, {
+               name: "tests10.dat #40"
+               html: "<svg><script></script><path>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg script>\n|       <svg path>\n"
+       }, {
+               name: "tests10.dat #41"
+               html: "<table><svg></svg><tr>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests10.dat #42"
+               html: "<math><mi><mglyph>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         <math mglyph>\n"
+       }, {
+               name: "tests10.dat #43"
+               html: "<math><mi><malignmark>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         <math malignmark>\n"
+       }, {
+               name: "tests10.dat #44"
+               html: "<math><mo><mglyph>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mo>\n|         <math mglyph>\n"
+       }, {
+               name: "tests10.dat #45"
+               html: "<math><mo><malignmark>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mo>\n|         <math malignmark>\n"
+       }, {
+               name: "tests10.dat #46"
+               html: "<math><mn><mglyph>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mn>\n|         <math mglyph>\n"
+       }, {
+               name: "tests10.dat #47"
+               html: "<math><mn><malignmark>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mn>\n|         <math malignmark>\n"
+       }, {
+               name: "tests10.dat #48"
+               html: "<math><ms><mglyph>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math ms>\n|         <math mglyph>\n"
+       }, {
+               name: "tests10.dat #49"
+               html: "<math><ms><malignmark>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math ms>\n|         <math malignmark>\n"
+       }, {
+               name: "tests10.dat #50"
+               html: "<math><mtext><mglyph>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mtext>\n|         <math mglyph>\n"
+       }, {
+               name: "tests10.dat #51"
+               html: "<math><mtext><malignmark>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mtext>\n|         <math malignmark>\n"
+       }, {
+               name: "tests10.dat #52"
+               html: "<math><annotation-xml><svg></svg></annotation-xml><mi>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         <svg svg>\n|       <math mi>\n"
+       }, {
+               name: "tests10.dat #53"
+               html: "<math><annotation-xml><svg><foreignObject><div><math><mi></mi></math><span></span></div></foreignObject><path></path></svg></annotation-xml><mi>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         <svg svg>\n|           <svg foreignObject>\n|             <div>\n|               <math math>\n|                 <math mi>\n|               <span>\n|           <svg path>\n|       <math mi>\n"
+       }, {
+               name: "tests10.dat #54"
+               html: "<math><annotation-xml><svg><foreignObject><math><mi><svg></svg></mi><mo></mo></math><span></span></foreignObject><path></path></svg></annotation-xml><mi>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         <svg svg>\n|           <svg foreignObject>\n|             <math math>\n|               <math mi>\n|                 <svg svg>\n|               <math mo>\n|             <span>\n|           <svg path>\n|       <math mi>\n"
+       }, {
+               name: "tests11.dat #1"
+               html: "<!DOCTYPE html><body><svg attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' diffuseConstant='' edgeMode='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       attributeName=\"\"\n|       attributeType=\"\"\n|       baseFrequency=\"\"\n|       baseProfile=\"\"\n|       calcMode=\"\"\n|       clipPathUnits=\"\"\n|       diffuseConstant=\"\"\n|       edgeMode=\"\"\n|       filterUnits=\"\"\n|       glyphRef=\"\"\n|       gradientTransform=\"\"\n|       gradientUnits=\"\"\n|       kernelMatrix=\"\"\n|       kernelUnitLength=\"\"\n|       keyPoints=\"\"\n|       keySplines=\"\"\n|       keyTimes=\"\"\n|       lengthAdjust=\"\"\n|       limitingConeAngle=\"\"\n|       markerHeight=\"\"\n|       markerUnits=\"\"\n|       markerWidth=\"\"\n|       maskContentUnits=\"\"\n|       maskUnits=\"\"\n|       numOctaves=\"\"\n|       pathLength=\"\"\n|       patternContentUnits=\"\"\n|       patternTransform=\"\"\n|       patternUnits=\"\"\n|       pointsAtX=\"\"\n|       pointsAtY=\"\"\n|       pointsAtZ=\"\"\n|       preserveAlpha=\"\"\n|       preserveAspectRatio=\"\"\n|       primitiveUnits=\"\"\n|       refX=\"\"\n|       refY=\"\"\n|       repeatCount=\"\"\n|       repeatDur=\"\"\n|       requiredExtensions=\"\"\n|       requiredFeatures=\"\"\n|       specularConstant=\"\"\n|       specularExponent=\"\"\n|       spreadMethod=\"\"\n|       startOffset=\"\"\n|       stdDeviation=\"\"\n|       stitchTiles=\"\"\n|       surfaceScale=\"\"\n|       systemLanguage=\"\"\n|       tableValues=\"\"\n|       targetX=\"\"\n|       targetY=\"\"\n|       textLength=\"\"\n|       viewBox=\"\"\n|       viewTarget=\"\"\n|       xChannelSelector=\"\"\n|       yChannelSelector=\"\"\n|       zoomAndPan=\"\"\n"
+       }, {
+               name: "tests11.dat #2"
+               html: "<!DOCTYPE html><BODY><SVG ATTRIBUTENAME='' ATTRIBUTETYPE='' BASEFREQUENCY='' BASEPROFILE='' CALCMODE='' CLIPPATHUNITS='' DIFFUSECONSTANT='' EDGEMODE='' FILTERUNITS='' GLYPHREF='' GRADIENTTRANSFORM='' GRADIENTUNITS='' KERNELMATRIX='' KERNELUNITLENGTH='' KEYPOINTS='' KEYSPLINES='' KEYTIMES='' LENGTHADJUST='' LIMITINGCONEANGLE='' MARKERHEIGHT='' MARKERUNITS='' MARKERWIDTH='' MASKCONTENTUNITS='' MASKUNITS='' NUMOCTAVES='' PATHLENGTH='' PATTERNCONTENTUNITS='' PATTERNTRANSFORM='' PATTERNUNITS='' POINTSATX='' POINTSATY='' POINTSATZ='' PRESERVEALPHA='' PRESERVEASPECTRATIO='' PRIMITIVEUNITS='' REFX='' REFY='' REPEATCOUNT='' REPEATDUR='' REQUIREDEXTENSIONS='' REQUIREDFEATURES='' SPECULARCONSTANT='' SPECULAREXPONENT='' SPREADMETHOD='' STARTOFFSET='' STDDEVIATION='' STITCHTILES='' SURFACESCALE='' SYSTEMLANGUAGE='' TABLEVALUES='' TARGETX='' TARGETY='' TEXTLENGTH='' VIEWBOX='' VIEWTARGET='' XCHANNELSELECTOR='' YCHANNELSELECTOR='' ZOOMANDPAN=''></SVG>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       attributeName=\"\"\n|       attributeType=\"\"\n|       baseFrequency=\"\"\n|       baseProfile=\"\"\n|       calcMode=\"\"\n|       clipPathUnits=\"\"\n|       diffuseConstant=\"\"\n|       edgeMode=\"\"\n|       filterUnits=\"\"\n|       glyphRef=\"\"\n|       gradientTransform=\"\"\n|       gradientUnits=\"\"\n|       kernelMatrix=\"\"\n|       kernelUnitLength=\"\"\n|       keyPoints=\"\"\n|       keySplines=\"\"\n|       keyTimes=\"\"\n|       lengthAdjust=\"\"\n|       limitingConeAngle=\"\"\n|       markerHeight=\"\"\n|       markerUnits=\"\"\n|       markerWidth=\"\"\n|       maskContentUnits=\"\"\n|       maskUnits=\"\"\n|       numOctaves=\"\"\n|       pathLength=\"\"\n|       patternContentUnits=\"\"\n|       patternTransform=\"\"\n|       patternUnits=\"\"\n|       pointsAtX=\"\"\n|       pointsAtY=\"\"\n|       pointsAtZ=\"\"\n|       preserveAlpha=\"\"\n|       preserveAspectRatio=\"\"\n|       primitiveUnits=\"\"\n|       refX=\"\"\n|       refY=\"\"\n|       repeatCount=\"\"\n|       repeatDur=\"\"\n|       requiredExtensions=\"\"\n|       requiredFeatures=\"\"\n|       specularConstant=\"\"\n|       specularExponent=\"\"\n|       spreadMethod=\"\"\n|       startOffset=\"\"\n|       stdDeviation=\"\"\n|       stitchTiles=\"\"\n|       surfaceScale=\"\"\n|       systemLanguage=\"\"\n|       tableValues=\"\"\n|       targetX=\"\"\n|       targetY=\"\"\n|       textLength=\"\"\n|       viewBox=\"\"\n|       viewTarget=\"\"\n|       xChannelSelector=\"\"\n|       yChannelSelector=\"\"\n|       zoomAndPan=\"\"\n"
+       }, {
+               name: "tests11.dat #3"
+               html: "<!DOCTYPE html><body><svg attributename='' attributetype='' basefrequency='' baseprofile='' calcmode='' clippathunits='' diffuseconstant='' edgemode='' filterunits='' filterres='' glyphref='' gradienttransform='' gradientunits='' kernelmatrix='' kernelunitlength='' keypoints='' keysplines='' keytimes='' lengthadjust='' limitingconeangle='' markerheight='' markerunits='' markerwidth='' maskcontentunits='' maskunits='' numoctaves='' pathlength='' patterncontentunits='' patterntransform='' patternunits='' pointsatx='' pointsaty='' pointsatz='' preservealpha='' preserveaspectratio='' primitiveunits='' refx='' refy='' repeatcount='' repeatdur='' requiredextensions='' requiredfeatures='' specularconstant='' specularexponent='' spreadmethod='' startoffset='' stddeviation='' stitchtiles='' surfacescale='' systemlanguage='' tablevalues='' targetx='' targety='' textlength='' viewbox='' viewtarget='' xchannelselector='' ychannelselector='' zoomandpan=''></svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       attributeName=\"\"\n|       attributeType=\"\"\n|       baseFrequency=\"\"\n|       baseProfile=\"\"\n|       calcMode=\"\"\n|       clipPathUnits=\"\"\n|       diffuseConstant=\"\"\n|       edgeMode=\"\"\n|       filterUnits=\"\"\n|       filterres=\"\"\n|       glyphRef=\"\"\n|       gradientTransform=\"\"\n|       gradientUnits=\"\"\n|       kernelMatrix=\"\"\n|       kernelUnitLength=\"\"\n|       keyPoints=\"\"\n|       keySplines=\"\"\n|       keyTimes=\"\"\n|       lengthAdjust=\"\"\n|       limitingConeAngle=\"\"\n|       markerHeight=\"\"\n|       markerUnits=\"\"\n|       markerWidth=\"\"\n|       maskContentUnits=\"\"\n|       maskUnits=\"\"\n|       numOctaves=\"\"\n|       pathLength=\"\"\n|       patternContentUnits=\"\"\n|       patternTransform=\"\"\n|       patternUnits=\"\"\n|       pointsAtX=\"\"\n|       pointsAtY=\"\"\n|       pointsAtZ=\"\"\n|       preserveAlpha=\"\"\n|       preserveAspectRatio=\"\"\n|       primitiveUnits=\"\"\n|       refX=\"\"\n|       refY=\"\"\n|       repeatCount=\"\"\n|       repeatDur=\"\"\n|       requiredExtensions=\"\"\n|       requiredFeatures=\"\"\n|       specularConstant=\"\"\n|       specularExponent=\"\"\n|       spreadMethod=\"\"\n|       startOffset=\"\"\n|       stdDeviation=\"\"\n|       stitchTiles=\"\"\n|       surfaceScale=\"\"\n|       systemLanguage=\"\"\n|       tableValues=\"\"\n|       targetX=\"\"\n|       targetY=\"\"\n|       textLength=\"\"\n|       viewBox=\"\"\n|       viewTarget=\"\"\n|       xChannelSelector=\"\"\n|       yChannelSelector=\"\"\n|       zoomAndPan=\"\"\n"
+       }, {
+               name: "tests11.dat #4"
+               html: "<!DOCTYPE html><body><math attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' diffuseConstant='' edgeMode='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></math>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       attributename=\"\"\n|       attributetype=\"\"\n|       basefrequency=\"\"\n|       baseprofile=\"\"\n|       calcmode=\"\"\n|       clippathunits=\"\"\n|       diffuseconstant=\"\"\n|       edgemode=\"\"\n|       filterunits=\"\"\n|       glyphref=\"\"\n|       gradienttransform=\"\"\n|       gradientunits=\"\"\n|       kernelmatrix=\"\"\n|       kernelunitlength=\"\"\n|       keypoints=\"\"\n|       keysplines=\"\"\n|       keytimes=\"\"\n|       lengthadjust=\"\"\n|       limitingconeangle=\"\"\n|       markerheight=\"\"\n|       markerunits=\"\"\n|       markerwidth=\"\"\n|       maskcontentunits=\"\"\n|       maskunits=\"\"\n|       numoctaves=\"\"\n|       pathlength=\"\"\n|       patterncontentunits=\"\"\n|       patterntransform=\"\"\n|       patternunits=\"\"\n|       pointsatx=\"\"\n|       pointsaty=\"\"\n|       pointsatz=\"\"\n|       preservealpha=\"\"\n|       preserveaspectratio=\"\"\n|       primitiveunits=\"\"\n|       refx=\"\"\n|       refy=\"\"\n|       repeatcount=\"\"\n|       repeatdur=\"\"\n|       requiredextensions=\"\"\n|       requiredfeatures=\"\"\n|       specularconstant=\"\"\n|       specularexponent=\"\"\n|       spreadmethod=\"\"\n|       startoffset=\"\"\n|       stddeviation=\"\"\n|       stitchtiles=\"\"\n|       surfacescale=\"\"\n|       systemlanguage=\"\"\n|       tablevalues=\"\"\n|       targetx=\"\"\n|       targety=\"\"\n|       textlength=\"\"\n|       viewbox=\"\"\n|       viewtarget=\"\"\n|       xchannelselector=\"\"\n|       ychannelselector=\"\"\n|       zoomandpan=\"\"\n"
+       }, {
+               name: "tests11.dat #5"
+               html: "<!DOCTYPE html><body><svg><altGlyph /><altGlyphDef /><altGlyphItem /><animateColor /><animateMotion /><animateTransform /><clipPath /><feBlend /><feColorMatrix /><feComponentTransfer /><feComposite /><feConvolveMatrix /><feDiffuseLighting /><feDisplacementMap /><feDistantLight /><feFlood /><feFuncA /><feFuncB /><feFuncG /><feFuncR /><feGaussianBlur /><feImage /><feMerge /><feMergeNode /><feMorphology /><feOffset /><fePointLight /><feSpecularLighting /><feSpotLight /><feTile /><feTurbulence /><foreignObject /><glyphRef /><linearGradient /><radialGradient /><textPath /></svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg altGlyph>\n|       <svg altGlyphDef>\n|       <svg altGlyphItem>\n|       <svg animateColor>\n|       <svg animateMotion>\n|       <svg animateTransform>\n|       <svg clipPath>\n|       <svg feBlend>\n|       <svg feColorMatrix>\n|       <svg feComponentTransfer>\n|       <svg feComposite>\n|       <svg feConvolveMatrix>\n|       <svg feDiffuseLighting>\n|       <svg feDisplacementMap>\n|       <svg feDistantLight>\n|       <svg feFlood>\n|       <svg feFuncA>\n|       <svg feFuncB>\n|       <svg feFuncG>\n|       <svg feFuncR>\n|       <svg feGaussianBlur>\n|       <svg feImage>\n|       <svg feMerge>\n|       <svg feMergeNode>\n|       <svg feMorphology>\n|       <svg feOffset>\n|       <svg fePointLight>\n|       <svg feSpecularLighting>\n|       <svg feSpotLight>\n|       <svg feTile>\n|       <svg feTurbulence>\n|       <svg foreignObject>\n|       <svg glyphRef>\n|       <svg linearGradient>\n|       <svg radialGradient>\n|       <svg textPath>\n"
+       }, {
+               name: "tests11.dat #6"
+               html: "<!DOCTYPE html><body><svg><altglyph /><altglyphdef /><altglyphitem /><animatecolor /><animatemotion /><animatetransform /><clippath /><feblend /><fecolormatrix /><fecomponenttransfer /><fecomposite /><feconvolvematrix /><fediffuselighting /><fedisplacementmap /><fedistantlight /><feflood /><fefunca /><fefuncb /><fefuncg /><fefuncr /><fegaussianblur /><feimage /><femerge /><femergenode /><femorphology /><feoffset /><fepointlight /><fespecularlighting /><fespotlight /><fetile /><feturbulence /><foreignobject /><glyphref /><lineargradient /><radialgradient /><textpath /></svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg altGlyph>\n|       <svg altGlyphDef>\n|       <svg altGlyphItem>\n|       <svg animateColor>\n|       <svg animateMotion>\n|       <svg animateTransform>\n|       <svg clipPath>\n|       <svg feBlend>\n|       <svg feColorMatrix>\n|       <svg feComponentTransfer>\n|       <svg feComposite>\n|       <svg feConvolveMatrix>\n|       <svg feDiffuseLighting>\n|       <svg feDisplacementMap>\n|       <svg feDistantLight>\n|       <svg feFlood>\n|       <svg feFuncA>\n|       <svg feFuncB>\n|       <svg feFuncG>\n|       <svg feFuncR>\n|       <svg feGaussianBlur>\n|       <svg feImage>\n|       <svg feMerge>\n|       <svg feMergeNode>\n|       <svg feMorphology>\n|       <svg feOffset>\n|       <svg fePointLight>\n|       <svg feSpecularLighting>\n|       <svg feSpotLight>\n|       <svg feTile>\n|       <svg feTurbulence>\n|       <svg foreignObject>\n|       <svg glyphRef>\n|       <svg linearGradient>\n|       <svg radialGradient>\n|       <svg textPath>\n"
+       }, {
+               name: "tests11.dat #7"
+               html: "<!DOCTYPE html><BODY><SVG><ALTGLYPH /><ALTGLYPHDEF /><ALTGLYPHITEM /><ANIMATECOLOR /><ANIMATEMOTION /><ANIMATETRANSFORM /><CLIPPATH /><FEBLEND /><FECOLORMATRIX /><FECOMPONENTTRANSFER /><FECOMPOSITE /><FECONVOLVEMATRIX /><FEDIFFUSELIGHTING /><FEDISPLACEMENTMAP /><FEDISTANTLIGHT /><FEFLOOD /><FEFUNCA /><FEFUNCB /><FEFUNCG /><FEFUNCR /><FEGAUSSIANBLUR /><FEIMAGE /><FEMERGE /><FEMERGENODE /><FEMORPHOLOGY /><FEOFFSET /><FEPOINTLIGHT /><FESPECULARLIGHTING /><FESPOTLIGHT /><FETILE /><FETURBULENCE /><FOREIGNOBJECT /><GLYPHREF /><LINEARGRADIENT /><RADIALGRADIENT /><TEXTPATH /></SVG>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg altGlyph>\n|       <svg altGlyphDef>\n|       <svg altGlyphItem>\n|       <svg animateColor>\n|       <svg animateMotion>\n|       <svg animateTransform>\n|       <svg clipPath>\n|       <svg feBlend>\n|       <svg feColorMatrix>\n|       <svg feComponentTransfer>\n|       <svg feComposite>\n|       <svg feConvolveMatrix>\n|       <svg feDiffuseLighting>\n|       <svg feDisplacementMap>\n|       <svg feDistantLight>\n|       <svg feFlood>\n|       <svg feFuncA>\n|       <svg feFuncB>\n|       <svg feFuncG>\n|       <svg feFuncR>\n|       <svg feGaussianBlur>\n|       <svg feImage>\n|       <svg feMerge>\n|       <svg feMergeNode>\n|       <svg feMorphology>\n|       <svg feOffset>\n|       <svg fePointLight>\n|       <svg feSpecularLighting>\n|       <svg feSpotLight>\n|       <svg feTile>\n|       <svg feTurbulence>\n|       <svg foreignObject>\n|       <svg glyphRef>\n|       <svg linearGradient>\n|       <svg radialGradient>\n|       <svg textPath>\n"
+       }, {
+               name: "tests11.dat #8"
+               html: "<!DOCTYPE html><body><math><altGlyph /><altGlyphDef /><altGlyphItem /><animateColor /><animateMotion /><animateTransform /><clipPath /><feBlend /><feColorMatrix /><feComponentTransfer /><feComposite /><feConvolveMatrix /><feDiffuseLighting /><feDisplacementMap /><feDistantLight /><feFlood /><feFuncA /><feFuncB /><feFuncG /><feFuncR /><feGaussianBlur /><feImage /><feMerge /><feMergeNode /><feMorphology /><feOffset /><fePointLight /><feSpecularLighting /><feSpotLight /><feTile /><feTurbulence /><foreignObject /><glyphRef /><linearGradient /><radialGradient /><textPath /></math>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math altglyph>\n|       <math altglyphdef>\n|       <math altglyphitem>\n|       <math animatecolor>\n|       <math animatemotion>\n|       <math animatetransform>\n|       <math clippath>\n|       <math feblend>\n|       <math fecolormatrix>\n|       <math fecomponenttransfer>\n|       <math fecomposite>\n|       <math feconvolvematrix>\n|       <math fediffuselighting>\n|       <math fedisplacementmap>\n|       <math fedistantlight>\n|       <math feflood>\n|       <math fefunca>\n|       <math fefuncb>\n|       <math fefuncg>\n|       <math fefuncr>\n|       <math fegaussianblur>\n|       <math feimage>\n|       <math femerge>\n|       <math femergenode>\n|       <math femorphology>\n|       <math feoffset>\n|       <math fepointlight>\n|       <math fespecularlighting>\n|       <math fespotlight>\n|       <math fetile>\n|       <math feturbulence>\n|       <math foreignobject>\n|       <math glyphref>\n|       <math lineargradient>\n|       <math radialgradient>\n|       <math textpath>\n"
+       }, {
+               name: "tests11.dat #9"
+               html: "<!DOCTYPE html><body><svg><solidColor /></svg>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg solidcolor>\n"
+       }, {
+               name: "tests12.dat #1"
+               html: "<!DOCTYPE html><body><p>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><P>spam<TABLE><tr><td><img></td></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"foo\"\n|       <math math>\n|         <math mtext>\n|           <i>\n|             \"baz\"\n|         <math annotation-xml>\n|           <svg svg>\n|             <svg desc>\n|               <b>\n|                 \"eggs\"\n|             <svg g>\n|               <svg foreignObject>\n|                 <p>\n|                   \"spam\"\n|                 <table>\n|                   <tbody>\n|                     <tr>\n|                       <td>\n|                         <img>\n|             <svg g>\n|               \"quux\"\n|       \"bar\"\n"
+       }, {
+               name: "tests12.dat #2"
+               html: "<!DOCTYPE html><body>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><P>spam<TABLE><tr><td><img></td></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"foo\"\n|     <math math>\n|       <math mtext>\n|         <i>\n|           \"baz\"\n|       <math annotation-xml>\n|         <svg svg>\n|           <svg desc>\n|             <b>\n|               \"eggs\"\n|           <svg g>\n|             <svg foreignObject>\n|               <p>\n|                 \"spam\"\n|               <table>\n|                 <tbody>\n|                   <tr>\n|                     <td>\n|                       <img>\n|           <svg g>\n|             \"quux\"\n|     \"bar\"\n"
+       }, {
+               name: "tests14.dat #1"
+               html: "<!DOCTYPE html><html><body><xyz:abc></xyz:abc>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <xyz:abc>\n"
+       }, {
+               name: "tests14.dat #2"
+               html: "<!DOCTYPE html><html><body><xyz:abc></xyz:abc><span></span>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <xyz:abc>\n|     <span>\n"
+       }, {
+               name: "tests14.dat #3"
+               html: "<!DOCTYPE html><html><html abc:def=gh><xyz:abc></xyz:abc>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   abc:def=\"gh\"\n|   <head>\n|   <body>\n|     <xyz:abc>\n"
+       }, {
+               name: "tests14.dat #4"
+               html: "<!DOCTYPE html><html xml:lang=bar><html xml:lang=foo>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   xml:lang=\"bar\"\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests14.dat #5"
+               html: "<!DOCTYPE html><html 123=456>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   123=\"456\"\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests14.dat #6"
+               html: "<!DOCTYPE html><html 123=456><html 789=012>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   123=\"456\"\n|   789=\"012\"\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests14.dat #7"
+               html: "<!DOCTYPE html><html><body 789=012>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     789=\"012\"\n"
+       }, {
+               name: "tests15.dat #1"
+               html: "<!DOCTYPE html><p><b><i><u></p> <p>X"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|         <i>\n|           <u>\n|     <b>\n|       <i>\n|         <u>\n|           \" \"\n|           <p>\n|             \"X\"\n"
+       }, {
+               name: "tests15.dat #2"
+               html: "<p><b><i><u></p>\n<p>X"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|         <i>\n|           <u>\n|     <b>\n|       <i>\n|         <u>\n|           \"\n\"\n|           <p>\n|             \"X\"\n"
+       }, {
+               name: "tests15.dat #3"
+               html: "<!doctype html></html> <head>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" \"\n"
+       }, {
+               name: "tests15.dat #4"
+               html: "<!doctype html></body><meta>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <meta>\n"
+       }, {
+               name: "tests15.dat #5"
+               html: "<html></html><!-- foo -->"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n| <!--  foo  -->\n"
+       }, {
+               name: "tests15.dat #6"
+               html: "<!doctype html></body><title>X</title>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <title>\n|       \"X\"\n"
+       }, {
+               name: "tests15.dat #7"
+               html: "<!doctype html><table> X<meta></table>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" X\"\n|     <meta>\n|     <table>\n"
+       }, {
+               name: "tests15.dat #8"
+               html: "<!doctype html><table> x</table>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" x\"\n|     <table>\n"
+       }, {
+               name: "tests15.dat #9"
+               html: "<!doctype html><table> x </table>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" x \"\n|     <table>\n"
+       }, {
+               name: "tests15.dat #10"
+               html: "<!doctype html><table><tr> x</table>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" x\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests15.dat #11"
+               html: "<!doctype html><table>X<style> <tr>x </style> </table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n|     <table>\n|       <style>\n|         \" <tr>x \"\n|       \" \"\n"
+       }, {
+               name: "tests15.dat #12"
+               html: "<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div>"
+               errors: 5
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <a>\n|         \"foo\"\n|       <table>\n|         \" \"\n|         <tbody>\n|           <tr>\n|             <td>\n|               \"bar\"\n|             \" \"\n"
+       }, {
+               name: "tests15.dat #13"
+               html: "<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes>"
+               errors: 7
+               expected: "| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n|     <frameset>\n|       <frame>\n|     <noframes>\n|       \"</frameset><noframes>\"\n"
+       }, {
+               name: "tests15.dat #14"
+               html: "<!DOCTYPE html><object></html>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <object>\n"
+       }, {
+               name: "tests16.dat #1"
+               html: "<!doctype html><script>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|   <body>\n"
+       }, {
+               name: "tests16.dat #2"
+               html: "<!doctype html><script>a"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #3"
+               html: "<!doctype html><script><"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #4"
+               html: "<!doctype html><script></"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #5"
+               html: "<!doctype html><script></S"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</S\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #6"
+               html: "<!doctype html><script></SC"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</SC\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #7"
+               html: "<!doctype html><script></SCR"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</SCR\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #8"
+               html: "<!doctype html><script></SCRI"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</SCRI\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #9"
+               html: "<!doctype html><script></SCRIP"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</SCRIP\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #10"
+               html: "<!doctype html><script></SCRIPT"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</SCRIPT\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #11"
+               html: "<!doctype html><script></SCRIPT "
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|   <body>\n"
+       }, {
+               name: "tests16.dat #12"
+               html: "<!doctype html><script></s"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</s\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #13"
+               html: "<!doctype html><script></sc"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</sc\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #14"
+               html: "<!doctype html><script></scr"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</scr\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #15"
+               html: "<!doctype html><script></scri"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</scri\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #16"
+               html: "<!doctype html><script></scrip"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</scrip\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #17"
+               html: "<!doctype html><script></script"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #18"
+               html: "<!doctype html><script></script "
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|   <body>\n"
+       }, {
+               name: "tests16.dat #19"
+               html: "<!doctype html><script><!"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #20"
+               html: "<!doctype html><script><!a"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #21"
+               html: "<!doctype html><script><!-"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!-\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #22"
+               html: "<!doctype html><script><!-a"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!-a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #23"
+               html: "<!doctype html><script><!--"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #24"
+               html: "<!doctype html><script><!--a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #25"
+               html: "<!doctype html><script><!--<"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #26"
+               html: "<!doctype html><script><!--<a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #27"
+               html: "<!doctype html><script><!--</"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--</\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #28"
+               html: "<!doctype html><script><!--</script"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--</script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #29"
+               html: "<!doctype html><script><!--</script "
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #30"
+               html: "<!doctype html><script><!--<s"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<s\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #31"
+               html: "<!doctype html><script><!--<script"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #32"
+               html: "<!doctype html><script><!--<script "
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script \"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #33"
+               html: "<!doctype html><script><!--<script <"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script <\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #34"
+               html: "<!doctype html><script><!--<script <a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script <a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #35"
+               html: "<!doctype html><script><!--<script </"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #36"
+               html: "<!doctype html><script><!--<script </s"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </s\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #37"
+               html: "<!doctype html><script><!--<script </script"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #38"
+               html: "<!doctype html><script><!--<script </scripta"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </scripta\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #39"
+               html: "<!doctype html><script><!--<script </script "
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #40"
+               html: "<!doctype html><script><!--<script </script>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script>\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #41"
+               html: "<!doctype html><script><!--<script </script/"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script/\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #42"
+               html: "<!doctype html><script><!--<script </script <"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script <\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #43"
+               html: "<!doctype html><script><!--<script </script <a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script <a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #44"
+               html: "<!doctype html><script><!--<script </script </"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script </\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #45"
+               html: "<!doctype html><script><!--<script </script </script"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script </script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #46"
+               html: "<!doctype html><script><!--<script </script </script "
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #47"
+               html: "<!doctype html><script><!--<script </script </script/"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #48"
+               html: "<!doctype html><script><!--<script </script </script>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #49"
+               html: "<!doctype html><script><!--<script -"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #50"
+               html: "<!doctype html><script><!--<script -a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #51"
+               html: "<!doctype html><script><!--<script -<"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -<\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #52"
+               html: "<!doctype html><script><!--<script --"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #53"
+               html: "<!doctype html><script><!--<script --a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #54"
+               html: "<!doctype html><script><!--<script --<"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --<\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #55"
+               html: "<!doctype html><script><!--<script -->"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #56"
+               html: "<!doctype html><script><!--<script --><"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --><\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #57"
+               html: "<!doctype html><script><!--<script --></"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --></\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #58"
+               html: "<!doctype html><script><!--<script --></script"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --></script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #59"
+               html: "<!doctype html><script><!--<script --></script "
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #60"
+               html: "<!doctype html><script><!--<script --></script/"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #61"
+               html: "<!doctype html><script><!--<script --></script>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #62"
+               html: "<!doctype html><script><!--<script><\\/script>--></script>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script><\\/script>-->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #63"
+               html: "<!doctype html><script><!--<script></scr'+'ipt>--></script>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></scr'+'ipt>-->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #64"
+               html: "<!doctype html><script><!--<script></script><script></script></script>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #65"
+               html: "<!doctype html><script><!--<script></script><script></script>--><!--</script>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>--><!--\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #66"
+               html: "<!doctype html><script><!--<script></script><script></script>-- ></script>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>-- >\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #67"
+               html: "<!doctype html><script><!--<script></script><script></script>- -></script>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>- ->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #68"
+               html: "<!doctype html><script><!--<script></script><script></script>- - ></script>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>- - >\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #69"
+               html: "<!doctype html><script><!--<script></script><script></script>-></script>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #70"
+               html: "<!doctype html><script><!--<script>--!></script>X"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script>--!></script>X\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #71"
+               html: "<!doctype html><script><!--<scr'+'ipt></script>--></script>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<scr'+'ipt>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #72"
+               html: "<!doctype html><script><!--<script></scr'+'ipt></script>X"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></scr'+'ipt></script>X\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #73"
+               html: "<!doctype html><style><!--<style></style>--></style>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--<style>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #74"
+               html: "<!doctype html><style><!--</style>X"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--\"\n|   <body>\n|     \"X\"\n"
+       }, {
+               name: "tests16.dat #75"
+               html: "<!doctype html><style><!--...</style>...--></style>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--...\"\n|   <body>\n|     \"...-->\"\n"
+       }, {
+               name: "tests16.dat #76"
+               html: "<!doctype html><style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style>\"\n|   <body>\n|     \"X\"\n"
+       }, {
+               name: "tests16.dat #77"
+               html: "<!doctype html><style><!--...<style><!--...--!></style>--></style>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--...<style><!--...--!>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #78"
+               html: "<!doctype html><style><!--...</style><!-- --><style>@import ...</style>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--...\"\n|     <!--   -->\n|     <style>\n|       \"@import ...\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #79"
+               html: "<!doctype html><style>...<style><!--...</style><!-- --></style>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"...<style><!--...\"\n|     <!--   -->\n|   <body>\n"
+       }, {
+               name: "tests16.dat #80"
+               html: "<!doctype html><style>...<!--[if IE]><style>...</style>X"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"...<!--[if IE]><style>...\"\n|   <body>\n|     \"X\"\n"
+       }, {
+               name: "tests16.dat #81"
+               html: "<!doctype html><title><!--<title></title>--></title>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"<!--<title>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #82"
+               html: "<!doctype html><title>&lt;/title></title>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"</title>\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #83"
+               html: "<!doctype html><title>foo/title><link></head><body>X"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"foo/title><link></head><body>X\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #84"
+               html: "<!doctype html><noscript><!--<noscript></noscript>--></noscript>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|       \"<!--<noscript>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #85"
+               html: "<!doctype html><noscript><!--<noscript></noscript>--></noscript>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|       <!-- <noscript></noscript> -->\n|   <body>\n"
+       }, {
+               name: "tests16.dat #86"
+               html: "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|       \"<!--\"\n|   <body>\n|     \"X\"\n|     <noscript>\n|       \"-->\"\n"
+       }, {
+               name: "tests16.dat #87"
+               html: "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|       <!-- </noscript>X<noscript> -->\n|   <body>\n"
+       }, {
+               name: "tests16.dat #88"
+               html: "<!doctype html><noscript><iframe></noscript>X"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|       \"<iframe>\"\n|   <body>\n|     \"X\"\n"
+       }, {
+               name: "tests16.dat #89"
+               html: "<!doctype html><noscript><iframe></noscript>X"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|   <body>\n|     <iframe>\n|       \"</noscript>X\"\n"
+       }, {
+               name: "tests16.dat #90"
+               html: "<!doctype html><noframes><!--<noframes></noframes>--></noframes>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noframes>\n|       \"<!--<noframes>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #91"
+               html: "<!doctype html><noframes><body><script><!--...</script></body></noframes></html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noframes>\n|       \"<body><script><!--...</script></body>\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #92"
+               html: "<!doctype html><textarea><!--<textarea></textarea>--></textarea>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<!--<textarea>\"\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #93"
+               html: "<!doctype html><textarea>&lt;/textarea></textarea>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"</textarea>\"\n"
+       }, {
+               name: "tests16.dat #94"
+               html: "<!doctype html><textarea>&lt;</textarea>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<\"\n"
+       }, {
+               name: "tests16.dat #95"
+               html: "<!doctype html><textarea>a&lt;b</textarea>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"a<b\"\n"
+       }, {
+               name: "tests16.dat #96"
+               html: "<!doctype html><iframe><!--<iframe></iframe>--></iframe>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \"<!--<iframe>\"\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #97"
+               html: "<!doctype html><iframe>...<!--X->...<!--/X->...</iframe>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \"...<!--X->...<!--/X->...\"\n"
+       }, {
+               name: "tests16.dat #98"
+               html: "<!doctype html><xmp><!--<xmp></xmp>--></xmp>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <xmp>\n|       \"<!--<xmp>\"\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #99"
+               html: "<!doctype html><noembed><!--<noembed></noembed>--></noembed>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <noembed>\n|       \"<!--<noembed>\"\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #100"
+               html: "<script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|   <body>\n"
+       }, {
+               name: "tests16.dat #101"
+               html: "<script>a"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #102"
+               html: "<script><"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #103"
+               html: "<script></"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #104"
+               html: "<script></S"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</S\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #105"
+               html: "<script></SC"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</SC\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #106"
+               html: "<script></SCR"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</SCR\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #107"
+               html: "<script></SCRI"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</SCRI\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #108"
+               html: "<script></SCRIP"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</SCRIP\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #109"
+               html: "<script></SCRIPT"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</SCRIPT\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #110"
+               html: "<script></SCRIPT "
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|   <body>\n"
+       }, {
+               name: "tests16.dat #111"
+               html: "<script></s"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</s\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #112"
+               html: "<script></sc"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</sc\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #113"
+               html: "<script></scr"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</scr\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #114"
+               html: "<script></scri"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</scri\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #115"
+               html: "<script></scrip"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</scrip\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #116"
+               html: "<script></script"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #117"
+               html: "<script></script "
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|   <body>\n"
+       }, {
+               name: "tests16.dat #118"
+               html: "<script><!"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #119"
+               html: "<script><!a"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #120"
+               html: "<script><!-"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!-\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #121"
+               html: "<script><!-a"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!-a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #122"
+               html: "<script><!--"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #123"
+               html: "<script><!--a"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #124"
+               html: "<script><!--<"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #125"
+               html: "<script><!--<a"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #126"
+               html: "<script><!--</"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--</\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #127"
+               html: "<script><!--</script"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--</script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #128"
+               html: "<script><!--</script "
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #129"
+               html: "<script><!--<s"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<s\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #130"
+               html: "<script><!--<script"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #131"
+               html: "<script><!--<script "
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script \"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #132"
+               html: "<script><!--<script <"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script <\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #133"
+               html: "<script><!--<script <a"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script <a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #134"
+               html: "<script><!--<script </"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #135"
+               html: "<script><!--<script </s"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </s\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #136"
+               html: "<script><!--<script </script"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #137"
+               html: "<script><!--<script </scripta"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </scripta\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #138"
+               html: "<script><!--<script </script "
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #139"
+               html: "<script><!--<script </script>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script>\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #140"
+               html: "<script><!--<script </script/"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script/\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #141"
+               html: "<script><!--<script </script <"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script <\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #142"
+               html: "<script><!--<script </script <a"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script <a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #143"
+               html: "<script><!--<script </script </"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script </\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #144"
+               html: "<script><!--<script </script </script"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script </script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #145"
+               html: "<script><!--<script </script </script "
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #146"
+               html: "<script><!--<script </script </script/"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #147"
+               html: "<script><!--<script </script </script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #148"
+               html: "<script><!--<script -"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #149"
+               html: "<script><!--<script -a"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #150"
+               html: "<script><!--<script --"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #151"
+               html: "<script><!--<script --a"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --a\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #152"
+               html: "<script><!--<script -->"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #153"
+               html: "<script><!--<script --><"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --><\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #154"
+               html: "<script><!--<script --></"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --></\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #155"
+               html: "<script><!--<script --></script"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --></script\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #156"
+               html: "<script><!--<script --></script "
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #157"
+               html: "<script><!--<script --></script/"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #158"
+               html: "<script><!--<script --></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #159"
+               html: "<script><!--<script><\\/script>--></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script><\\/script>-->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #160"
+               html: "<script><!--<script></scr'+'ipt>--></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></scr'+'ipt>-->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #161"
+               html: "<script><!--<script></script><script></script></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #162"
+               html: "<script><!--<script></script><script></script>--><!--</script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>--><!--\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #163"
+               html: "<script><!--<script></script><script></script>-- ></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>-- >\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #164"
+               html: "<script><!--<script></script><script></script>- -></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>- ->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #165"
+               html: "<script><!--<script></script><script></script>- - ></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>- - >\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #166"
+               html: "<script><!--<script></script><script></script>-></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>->\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #167"
+               html: "<script><!--<script>--!></script>X"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script>--!></script>X\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #168"
+               html: "<script><!--<scr'+'ipt></script>--></script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<scr'+'ipt>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #169"
+               html: "<script><!--<script></scr'+'ipt></script>X"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></scr'+'ipt></script>X\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #170"
+               html: "<style><!--<style></style>--></style>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--<style>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #171"
+               html: "<style><!--</style>X"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--\"\n|   <body>\n|     \"X\"\n"
+       }, {
+               name: "tests16.dat #172"
+               html: "<style><!--...</style>...--></style>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--...\"\n|   <body>\n|     \"...-->\"\n"
+       }, {
+               name: "tests16.dat #173"
+               html: "<style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style>\"\n|   <body>\n|     \"X\"\n"
+       }, {
+               name: "tests16.dat #174"
+               html: "<style><!--...<style><!--...--!></style>--></style>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--...<style><!--...--!>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #175"
+               html: "<style><!--...</style><!-- --><style>@import ...</style>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--...\"\n|     <!--   -->\n|     <style>\n|       \"@import ...\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #176"
+               html: "<style>...<style><!--...</style><!-- --></style>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"...<style><!--...\"\n|     <!--   -->\n|   <body>\n"
+       }, {
+               name: "tests16.dat #177"
+               html: "<style>...<!--[if IE]><style>...</style>X"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"...<!--[if IE]><style>...\"\n|   <body>\n|     \"X\"\n"
+       }, {
+               name: "tests16.dat #178"
+               html: "<title><!--<title></title>--></title>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <title>\n|       \"<!--<title>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #179"
+               html: "<title>&lt;/title></title>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <title>\n|       \"</title>\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #180"
+               html: "<title>foo/title><link></head><body>X"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <title>\n|       \"foo/title><link></head><body>X\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #181"
+               html: "<noscript><!--<noscript></noscript>--></noscript>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <noscript>\n|       \"<!--<noscript>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #182"
+               html: "<noscript><!--<noscript></noscript>--></noscript>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <noscript>\n|       <!-- <noscript></noscript> -->\n|   <body>\n"
+       }, {
+               name: "tests16.dat #183"
+               html: "<noscript><!--</noscript>X<noscript>--></noscript>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <noscript>\n|       \"<!--\"\n|   <body>\n|     \"X\"\n|     <noscript>\n|       \"-->\"\n"
+       }, {
+               name: "tests16.dat #184"
+               html: "<noscript><!--</noscript>X<noscript>--></noscript>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <noscript>\n|       <!-- </noscript>X<noscript> -->\n|   <body>\n"
+       }, {
+               name: "tests16.dat #185"
+               html: "<noscript><iframe></noscript>X"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <noscript>\n|       \"<iframe>\"\n|   <body>\n|     \"X\"\n"
+       }, {
+               name: "tests16.dat #186"
+               html: "<noscript><iframe></noscript>X"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <noscript>\n|   <body>\n|     <iframe>\n|       \"</noscript>X\"\n"
+       }, {
+               name: "tests16.dat #187"
+               html: "<noframes><!--<noframes></noframes>--></noframes>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <noframes>\n|       \"<!--<noframes>\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #188"
+               html: "<noframes><body><script><!--...</script></body></noframes></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <noframes>\n|       \"<body><script><!--...</script></body>\"\n|   <body>\n"
+       }, {
+               name: "tests16.dat #189"
+               html: "<textarea><!--<textarea></textarea>--></textarea>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<!--<textarea>\"\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #190"
+               html: "<textarea>&lt;/textarea></textarea>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"</textarea>\"\n"
+       }, {
+               name: "tests16.dat #191"
+               html: "<iframe><!--<iframe></iframe>--></iframe>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \"<!--<iframe>\"\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #192"
+               html: "<iframe>...<!--X->...<!--/X->...</iframe>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \"...<!--X->...<!--/X->...\"\n"
+       }, {
+               name: "tests16.dat #193"
+               html: "<xmp><!--<xmp></xmp>--></xmp>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <xmp>\n|       \"<!--<xmp>\"\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #194"
+               html: "<noembed><!--<noembed></noembed>--></noembed>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <noembed>\n|       \"<!--<noembed>\"\n|     \"-->\"\n"
+       }, {
+               name: "tests16.dat #195"
+               html: "<!doctype html><table>\n"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       \"\n\"\n"
+       }, {
+               name: "tests16.dat #196"
+               html: "<!doctype html><table><td><span><font></span><span>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <span>\n|               <font>\n|             <font>\n|               <span>\n"
+       }, {
+               name: "tests16.dat #197"
+               html: "<!doctype html><form><table></form><form></table></form>"
+               errors: 5
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <table>\n|         <form>\n"
+       }, {
+               name: "tests17.dat #1"
+               html: "<!doctype html><table><tbody><select><tr>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests17.dat #2"
+               html: "<!doctype html><table><tr><select><td>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "tests17.dat #3"
+               html: "<!doctype html><table><tr><td><select><td>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <select>\n|           <td>\n"
+       }, {
+               name: "tests17.dat #4"
+               html: "<!doctype html><table><tr><th><select><td>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <th>\n|             <select>\n|           <td>\n"
+       }, {
+               name: "tests17.dat #5"
+               html: "<!doctype html><table><caption><select><tr>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <select>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests17.dat #6"
+               html: "<!doctype html><select><tr>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "tests17.dat #7"
+               html: "<!doctype html><select><td>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "tests17.dat #8"
+               html: "<!doctype html><select><th>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "tests17.dat #9"
+               html: "<!doctype html><select><tbody>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "tests17.dat #10"
+               html: "<!doctype html><select><thead>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "tests17.dat #11"
+               html: "<!doctype html><select><tfoot>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "tests17.dat #12"
+               html: "<!doctype html><select><caption>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "tests17.dat #13"
+               html: "<!doctype html><table><tr></table>a"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|     \"a\"\n"
+       }, {
+               name: "tests18.dat #1"
+               html: "<!doctype html><plaintext></plaintext>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"</plaintext>\"\n"
+       }, {
+               name: "tests18.dat #2"
+               html: "<!doctype html><table><plaintext></plaintext>"
+               errors: 14
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"</plaintext>\"\n|     <table>\n"
+       }, {
+               name: "tests18.dat #3"
+               html: "<!doctype html><table><tbody><plaintext></plaintext>"
+               errors: 14
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"</plaintext>\"\n|     <table>\n|       <tbody>\n"
+       }, {
+               name: "tests18.dat #4"
+               html: "<!doctype html><table><tbody><tr><plaintext></plaintext>"
+               errors: 14
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"</plaintext>\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests18.dat #5"
+               html: "<!doctype html><table><td><plaintext></plaintext>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <plaintext>\n|               \"</plaintext>\"\n"
+       }, {
+               name: "tests18.dat #6"
+               html: "<!doctype html><table><caption><plaintext></plaintext>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <plaintext>\n|           \"</plaintext>\"\n"
+       }, {
+               name: "tests18.dat #7"
+               html: "<!doctype html><table><tr><style></script></style>abc"
+               errors: 4
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"abc\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <style>\n|             \"</script>\"\n"
+       }, {
+               name: "tests18.dat #8"
+               html: "<!doctype html><table><tr><script></style></script>abc"
+               errors: 4
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"abc\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <script>\n|             \"</style>\"\n"
+       }, {
+               name: "tests18.dat #9"
+               html: "<!doctype html><table><caption><style></script></style>abc"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <style>\n|           \"</script>\"\n|         \"abc\"\n"
+       }, {
+               name: "tests18.dat #10"
+               html: "<!doctype html><table><td><style></script></style>abc"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <style>\n|               \"</script>\"\n|             \"abc\"\n"
+       }, {
+               name: "tests18.dat #11"
+               html: "<!doctype html><select><script></style></script>abc"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <script>\n|         \"</style>\"\n|       \"abc\"\n"
+       }, {
+               name: "tests18.dat #12"
+               html: "<!doctype html><table><select><script></style></script>abc"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <script>\n|         \"</style>\"\n|       \"abc\"\n|     <table>\n"
+       }, {
+               name: "tests18.dat #13"
+               html: "<!doctype html><table><tr><select><script></style></script>abc"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <script>\n|         \"</style>\"\n|       \"abc\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests18.dat #14"
+               html: "<!doctype html><frameset></frameset><noframes>abc"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   <noframes>\n|     \"abc\"\n"
+       }, {
+               name: "tests18.dat #15"
+               html: "<!doctype html><frameset></frameset><noframes>abc</noframes><!--abc-->"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   <noframes>\n|     \"abc\"\n|   <!-- abc -->\n"
+       }, {
+               name: "tests18.dat #16"
+               html: "<!doctype html><frameset></frameset></html><noframes>abc"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   <noframes>\n|     \"abc\"\n"
+       }, {
+               name: "tests18.dat #17"
+               html: "<!doctype html><frameset></frameset></html><noframes>abc</noframes><!--abc-->"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   <noframes>\n|     \"abc\"\n| <!-- abc -->\n"
+       }, {
+               name: "tests18.dat #18"
+               html: "<!doctype html><table><tr></tbody><tfoot>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|       <tfoot>\n"
+       }, {
+               name: "tests18.dat #19"
+               html: "<!doctype html><table><td><svg></svg>abc<td>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|             \"abc\"\n|           <td>\n"
+       }, {
+               name: "tests19.dat #1"
+               html: "<!doctype html><math><mn DefinitionUrl=\"foo\">"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mn>\n|         definitionURL=\"foo\"\n"
+       }, {
+               name: "tests19.dat #2"
+               html: "<!doctype html><html></p><!--foo-->"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <!-- foo -->\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests19.dat #3"
+               html: "<!doctype html><head></head></p><!--foo-->"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <!-- foo -->\n|   <body>\n"
+       }, {
+               name: "tests19.dat #4"
+               html: "<!doctype html><body><p><pre>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <pre>\n"
+       }, {
+               name: "tests19.dat #5"
+               html: "<!doctype html><body><p><listing>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <listing>\n"
+       }, {
+               name: "tests19.dat #6"
+               html: "<!doctype html><p><plaintext>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <plaintext>\n"
+       }, {
+               name: "tests19.dat #7"
+               html: "<!doctype html><p><h1>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <h1>\n"
+       }, {
+               name: "tests19.dat #8"
+               html: "<!doctype html><form><isindex>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n"
+       }, {
+               name: "tests19.dat #9"
+               html: "<!doctype html><isindex action=\"POST\">"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       action=\"POST\"\n|       <hr>\n|       <label>\n|         \"This is a searchable index. Enter search keywords: \"\n|         <input>\n|           name=\"isindex\"\n|       <hr>\n"
+       }, {
+               name: "tests19.dat #10"
+               html: "<!doctype html><isindex prompt=\"this is isindex\">"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <hr>\n|       <label>\n|         \"this is isindex\"\n|         <input>\n|           name=\"isindex\"\n|       <hr>\n"
+       }, {
+               name: "tests19.dat #11"
+               html: "<!doctype html><isindex type=\"hidden\">"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <hr>\n|       <label>\n|         \"This is a searchable index. Enter search keywords: \"\n|         <input>\n|           name=\"isindex\"\n|           type=\"hidden\"\n|       <hr>\n"
+       }, {
+               name: "tests19.dat #12"
+               html: "<!doctype html><isindex name=\"foo\">"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <hr>\n|       <label>\n|         \"This is a searchable index. Enter search keywords: \"\n|         <input>\n|           name=\"isindex\"\n|       <hr>\n"
+       }, {
+               name: "tests19.dat #13"
+               html: "<!doctype html><ruby><p><rp>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <p>\n|       <rp>\n"
+       }, {
+               name: "tests19.dat #14"
+               html: "<!doctype html><ruby><div><span><rp>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <span>\n|           <rp>\n"
+       }, {
+               name: "tests19.dat #15"
+               html: "<!doctype html><ruby><div><p><rp>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <p>\n|         <rp>\n"
+       }, {
+               name: "tests19.dat #16"
+               html: "<!doctype html><ruby><p><rt>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <p>\n|       <rt>\n"
+       }, {
+               name: "tests19.dat #17"
+               html: "<!doctype html><ruby><div><span><rt>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <span>\n|           <rt>\n"
+       }, {
+               name: "tests19.dat #18"
+               html: "<!doctype html><ruby><div><p><rt>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <p>\n|         <rt>\n"
+       }, {
+               name: "tests19.dat #19"
+               html: "<html><ruby>a<rb>b<rt></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|       <rt>\n"
+       }, {
+               name: "tests19.dat #20"
+               html: "<html><ruby>a<rp>b<rt></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|       <rt>\n"
+       }, {
+               name: "tests19.dat #21"
+               html: "<html><ruby>a<rt>b<rt></ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|       <rt>\n"
+       }, {
+               name: "tests19.dat #22"
+               html: "<html><ruby>a<rtc>b<rt>c<rb>d</ruby></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|         <rt>\n|           \"c\"\n|       <rb>\n|         \"d\"\n"
+       }, {
+               name: "tests19.dat #23"
+               html: "<!doctype html><math/><foo>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|     <foo>\n"
+       }, {
+               name: "tests19.dat #24"
+               html: "<!doctype html><svg/><foo>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <foo>\n"
+       }, {
+               name: "tests19.dat #25"
+               html: "<!doctype html><div></body><!--foo-->"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|   <!-- foo -->\n"
+       }, {
+               name: "tests19.dat #26"
+               html: "<!doctype html><h1><div><h3><span></h1>foo"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <h1>\n|       <div>\n|         <h3>\n|           <span>\n|         \"foo\"\n"
+       }, {
+               name: "tests19.dat #27"
+               html: "<!doctype html><p></h3>foo"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"foo\"\n"
+       }, {
+               name: "tests19.dat #28"
+               html: "<!doctype html><h3><li>abc</h2>foo"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <h3>\n|       <li>\n|         \"abc\"\n|     \"foo\"\n"
+       }, {
+               name: "tests19.dat #29"
+               html: "<!doctype html><table>abc<!--foo-->"
+               errors: 4
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"abc\"\n|     <table>\n|       <!-- foo -->\n"
+       }, {
+               name: "tests19.dat #30"
+               html: "<!doctype html><table>  <!--foo-->"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       \"  \"\n|       <!-- foo -->\n"
+       }, {
+               name: "tests19.dat #31"
+               html: "<!doctype html><table> b <!--foo-->"
+               errors: 4
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" b \"\n|     <table>\n|       <!-- foo -->\n"
+       }, {
+               name: "tests19.dat #32"
+               html: "<!doctype html><select><option><option>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|       <option>\n"
+       }, {
+               name: "tests19.dat #33"
+               html: "<!doctype html><select><option></optgroup>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n"
+       }, {
+               name: "tests19.dat #34"
+               html: "<!doctype html><select><option></optgroup>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n"
+       }, {
+               name: "tests19.dat #35"
+               html: "<!doctype html><dd><optgroup><dd>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <dd>\n|       <optgroup>\n|     <dd>\n"
+       }, {
+               name: "tests19.dat #36"
+               html: "<!doctype html><p><math><mi><p><h1>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math mi>\n|           <p>\n|           <h1>\n"
+       }, {
+               name: "tests19.dat #37"
+               html: "<!doctype html><p><math><mo><p><h1>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math mo>\n|           <p>\n|           <h1>\n"
+       }, {
+               name: "tests19.dat #38"
+               html: "<!doctype html><p><math><mn><p><h1>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math mn>\n|           <p>\n|           <h1>\n"
+       }, {
+               name: "tests19.dat #39"
+               html: "<!doctype html><p><math><ms><p><h1>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math ms>\n|           <p>\n|           <h1>\n"
+       }, {
+               name: "tests19.dat #40"
+               html: "<!doctype html><p><math><mtext><p><h1>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math mtext>\n|           <p>\n|           <h1>\n"
+       }, {
+               name: "tests19.dat #41"
+               html: "<!doctype html><frameset></noframes>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests19.dat #42"
+               html: "<!doctype html><html c=d><body></html><html a=b>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   a=\"b\"\n|   c=\"d\"\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests19.dat #43"
+               html: "<!doctype html><html c=d><frameset></frameset></html><html a=b>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   a=\"b\"\n|   c=\"d\"\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests19.dat #44"
+               html: "<!doctype html><html><frameset></frameset></html><!--foo-->"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n| <!-- foo -->\n"
+       }, {
+               name: "tests19.dat #45"
+               html: "<!doctype html><html><frameset></frameset></html>  "
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   \"  \"\n"
+       }, {
+               name: "tests19.dat #46"
+               html: "<!doctype html><html><frameset></frameset></html>abc"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests19.dat #47"
+               html: "<!doctype html><html><frameset></frameset></html><p>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests19.dat #48"
+               html: "<!doctype html><html><frameset></frameset></html></p>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests19.dat #49"
+               html: "<html><frameset></frameset></html><!doctype html>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests19.dat #50"
+               html: "<!doctype html><body><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests19.dat #51"
+               html: "<!doctype html><p><frameset><frame>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
+       }, {
+               name: "tests19.dat #52"
+               html: "<!doctype html><p>a<frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"a\"\n"
+       }, {
+               name: "tests19.dat #53"
+               html: "<!doctype html><p> <frameset><frame>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
+       }, {
+               name: "tests19.dat #54"
+               html: "<!doctype html><pre><frameset>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n"
+       }, {
+               name: "tests19.dat #55"
+               html: "<!doctype html><listing><frameset>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <listing>\n"
+       }, {
+               name: "tests19.dat #56"
+               html: "<!doctype html><li><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <li>\n"
+       }, {
+               name: "tests19.dat #57"
+               html: "<!doctype html><dd><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <dd>\n"
+       }, {
+               name: "tests19.dat #58"
+               html: "<!doctype html><dt><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <dt>\n"
+       }, {
+               name: "tests19.dat #59"
+               html: "<!doctype html><button><frameset>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <button>\n"
+       }, {
+               name: "tests19.dat #60"
+               html: "<!doctype html><applet><frameset>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <applet>\n"
+       }, {
+               name: "tests19.dat #61"
+               html: "<!doctype html><marquee><frameset>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <marquee>\n"
+       }, {
+               name: "tests19.dat #62"
+               html: "<!doctype html><object><frameset>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <object>\n"
+       }, {
+               name: "tests19.dat #63"
+               html: "<!doctype html><table><frameset>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n"
+       }, {
+               name: "tests19.dat #64"
+               html: "<!doctype html><area><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <area>\n"
+       }, {
+               name: "tests19.dat #65"
+               html: "<!doctype html><basefont><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <basefont>\n|   <frameset>\n"
+       }, {
+               name: "tests19.dat #66"
+               html: "<!doctype html><bgsound><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <bgsound>\n|   <frameset>\n"
+       }, {
+               name: "tests19.dat #67"
+               html: "<!doctype html><br><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <br>\n"
+       }, {
+               name: "tests19.dat #68"
+               html: "<!doctype html><embed><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <embed>\n"
+       }, {
+               name: "tests19.dat #69"
+               html: "<!doctype html><img><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <img>\n"
+       }, {
+               name: "tests19.dat #70"
+               html: "<!doctype html><input><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <input>\n"
+       }, {
+               name: "tests19.dat #71"
+               html: "<!doctype html><keygen><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <keygen>\n"
+       }, {
+               name: "tests19.dat #72"
+               html: "<!doctype html><wbr><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <wbr>\n"
+       }, {
+               name: "tests19.dat #73"
+               html: "<!doctype html><hr><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <hr>\n"
+       }, {
+               name: "tests19.dat #74"
+               html: "<!doctype html><textarea></textarea><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n"
+       }, {
+               name: "tests19.dat #75"
+               html: "<!doctype html><xmp></xmp><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <xmp>\n"
+       }, {
+               name: "tests19.dat #76"
+               html: "<!doctype html><iframe></iframe><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <iframe>\n"
+       }, {
+               name: "tests19.dat #77"
+               html: "<!doctype html><select></select><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "tests19.dat #78"
+               html: "<!doctype html><svg></svg><frameset><frame>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
+       }, {
+               name: "tests19.dat #79"
+               html: "<!doctype html><math></math><frameset><frame>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
+       }, {
+               name: "tests19.dat #80"
+               html: "<!doctype html><svg><foreignObject><div> <frameset><frame>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
+       }, {
+               name: "tests19.dat #81"
+               html: "<!doctype html><svg>a</svg><frameset><frame>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"a\"\n"
+       }, {
+               name: "tests19.dat #82"
+               html: "<!doctype html><svg> </svg><frameset><frame>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
+       }, {
+               name: "tests19.dat #83"
+               html: "<html>aaa<frameset></frameset>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"aaa\"\n"
+       }, {
+               name: "tests19.dat #84"
+               html: "<html> a <frameset></frameset>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"a \"\n"
+       }, {
+               name: "tests19.dat #85"
+               html: "<!doctype html><div><frameset>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests19.dat #86"
+               html: "<!doctype html><div><body><frameset>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n"
+       }, {
+               name: "tests19.dat #87"
+               html: "<!doctype html><p><math></p>a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|     \"a\"\n"
+       }, {
+               name: "tests19.dat #88"
+               html: "<!doctype html><p><math><mn><span></p>a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math mn>\n|           <span>\n|             <p>\n|             \"a\"\n"
+       }, {
+               name: "tests19.dat #89"
+               html: "<!doctype html><math></html>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n"
+       }, {
+               name: "tests19.dat #90"
+               html: "<!doctype html><meta charset=\"ascii\">"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <meta>\n|       charset=\"ascii\"\n|   <body>\n"
+       }, {
+               name: "tests19.dat #91"
+               html: "<!doctype html><meta http-equiv=\"content-type\" content=\"text/html;charset=ascii\">"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <meta>\n|       content=\"text/html;charset=ascii\"\n|       http-equiv=\"content-type\"\n|   <body>\n"
+       }, {
+               name: "tests19.dat #92"
+               html: "<!doctype html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset=\"utf8\">"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <!-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -->\n|     <meta>\n|       charset=\"utf8\"\n|   <body>\n"
+       }, {
+               name: "tests19.dat #93"
+               html: "<!doctype html><html a=b><head></head><html c=d>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   a=\"b\"\n|   c=\"d\"\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests19.dat #94"
+               html: "<!doctype html><image/>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <img>\n"
+       }, {
+               name: "tests19.dat #95"
+               html: "<!doctype html>a<i>b<table>c<b>d</i>e</b>f"
+               errors: 9
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"a\"\n|     <i>\n|       \"bc\"\n|       <b>\n|         \"de\"\n|       \"f\"\n|       <table>\n"
+       }, {
+               name: "tests19.dat #96"
+               html: "<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f"
+               errors: 17
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"a\"\n|       <b>\n|         \"b\"\n|     <b>\n|     <div>\n|       <b>\n|         <i>\n|           \"c\"\n|           <a>\n|             \"d\"\n|         <a>\n|           \"e\"\n|       <a>\n|         \"f\"\n|     <table>\n"
+       }, {
+               name: "tests19.dat #97"
+               html: "<!doctype html><i>a<b>b<div>c<a>d</i>e</b>f"
+               errors: 5
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"a\"\n|       <b>\n|         \"b\"\n|     <b>\n|     <div>\n|       <b>\n|         <i>\n|           \"c\"\n|           <a>\n|             \"d\"\n|         <a>\n|           \"e\"\n|       <a>\n|         \"f\"\n"
+       }, {
+               name: "tests19.dat #98"
+               html: "<!doctype html><table><i>a<b>b<div>c</i>"
+               errors: 9
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"a\"\n|       <b>\n|         \"b\"\n|     <b>\n|       <div>\n|         <i>\n|           \"c\"\n|     <table>\n"
+       }, {
+               name: "tests19.dat #99"
+               html: "<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f"
+               errors: 17
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"a\"\n|       <b>\n|         \"b\"\n|     <b>\n|     <div>\n|       <b>\n|         <i>\n|           \"c\"\n|           <a>\n|             \"d\"\n|         <a>\n|           \"e\"\n|       <a>\n|         \"f\"\n|     <table>\n"
+       }, {
+               name: "tests19.dat #100"
+               html: "<!doctype html><table><i>a<div>b<tr>c<b>d</i>e"
+               errors: 11
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"a\"\n|       <div>\n|         \"b\"\n|     <i>\n|       \"c\"\n|       <b>\n|         \"d\"\n|     <b>\n|       \"e\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests19.dat #101"
+               html: "<!doctype html><table><td><table><i>a<div>b<b>c</i>d"
+               errors: 12
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <i>\n|               \"a\"\n|             <div>\n|               <i>\n|                 \"b\"\n|                 <b>\n|                   \"c\"\n|               <b>\n|                 \"d\"\n|             <table>\n"
+       }, {
+               name: "tests19.dat #102"
+               html: "<!doctype html><body><bgsound>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <bgsound>\n"
+       }, {
+               name: "tests19.dat #103"
+               html: "<!doctype html><body><basefont>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <basefont>\n"
+       }, {
+               name: "tests19.dat #104"
+               html: "<!doctype html><a><b></a><basefont>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|     <basefont>\n"
+       }, {
+               name: "tests19.dat #105"
+               html: "<!doctype html><a><b></a><bgsound>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|     <bgsound>\n"
+       }, {
+               name: "tests19.dat #106"
+               html: "<!doctype html><figcaption><article></figcaption>a"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <figcaption>\n|       <article>\n|     \"a\"\n"
+       }, {
+               name: "tests19.dat #107"
+               html: "<!doctype html><summary><article></summary>a"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <summary>\n|       <article>\n|     \"a\"\n"
+       }, {
+               name: "tests19.dat #108"
+               html: "<!doctype html><p><a><plaintext>b"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <a>\n|     <plaintext>\n|       <a>\n|         \"b\"\n"
+       }, {
+               name: "tests19.dat #109"
+               html: "<!DOCTYPE html><div>a<a></div>b<p>c</p>d"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"a\"\n|       <a>\n|     <a>\n|       \"b\"\n|       <p>\n|         \"c\"\n|       \"d\"\n"
+       }, {
+               name: "tests1.dat #1"
+               html: "Test"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"Test\"\n"
+       }, {
+               name: "tests1.dat #2"
+               html: "<p>One<p>Two"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"One\"\n|     <p>\n|       \"Two\"\n"
+       }, {
+               name: "tests1.dat #3"
+               html: "Line1<br>Line2<br>Line3<br>Line4"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"Line1\"\n|     <br>\n|     \"Line2\"\n|     <br>\n|     \"Line3\"\n|     <br>\n|     \"Line4\"\n"
+       }, {
+               name: "tests1.dat #4"
+               html: "<html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #5"
+               html: "<head>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #6"
+               html: "<body>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #7"
+               html: "<html><head>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #8"
+               html: "<html><head></head>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #9"
+               html: "<html><head></head><body>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #10"
+               html: "<html><head></head><body></body>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #11"
+               html: "<html><head><body></body></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #12"
+               html: "<html><head></body></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #13"
+               html: "<html><head><body></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #14"
+               html: "<html><body></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #15"
+               html: "<body></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #16"
+               html: "<head></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #17"
+               html: "</head>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #18"
+               html: "</body>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #19"
+               html: "</html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #20"
+               html: "<b><table><td><i></table>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <i>\n"
+       }, {
+               name: "tests1.dat #21"
+               html: "<b><table><td></b><i></table>X"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <i>\n|       \"X\"\n"
+       }, {
+               name: "tests1.dat #22"
+               html: "<h1>Hello<h2>World"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <h1>\n|       \"Hello\"\n|     <h2>\n|       \"World\"\n"
+       }, {
+               name: "tests1.dat #23"
+               html: "<a><p>X<a>Y</a>Z</p></a>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <p>\n|       <a>\n|         \"X\"\n|       <a>\n|         \"Y\"\n|       \"Z\"\n"
+       }, {
+               name: "tests1.dat #24"
+               html: "<b><button>foo</b>bar"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|     <button>\n|       <b>\n|         \"foo\"\n|       \"bar\"\n"
+       }, {
+               name: "tests1.dat #25"
+               html: "<!DOCTYPE html><span><button>foo</span>bar"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <span>\n|       <button>\n|         \"foobar\"\n"
+       }, {
+               name: "tests1.dat #26"
+               html: "<p><b><div><marquee></p></b></div>X"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|     <div>\n|       <b>\n|         <marquee>\n|           <p>\n|           \"X\"\n"
+       }, {
+               name: "tests1.dat #27"
+               html: "<script><div></script></div><title><p></title><p><p>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"<div>\"\n|     <title>\n|       \"<p>\"\n|   <body>\n|     <p>\n|     <p>\n"
+       }, {
+               name: "tests1.dat #28"
+               html: "<!--><div>--<!-->"
+               errors: 4
+               expected: "| <!--  -->\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"--\"\n|       <!--  -->\n"
+       }, {
+               name: "tests1.dat #29"
+               html: "<p><hr></p>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <hr>\n|     <p>\n"
+       }, {
+               name: "tests1.dat #30"
+               html: "<select><b><option><select><option></b></select>X"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|     <option>\n|       \"X\"\n"
+       }, {
+               name: "tests1.dat #31"
+               html: "<a><table><td><a><table></table><a></tr><a></table><b>X</b>C<a>Y"
+               errors: 9
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <a>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <a>\n|                 <table>\n|               <a>\n|     <a>\n|       <b>\n|         \"X\"\n|       \"C\"\n|     <a>\n|       \"Y\"\n"
+       }, {
+               name: "tests1.dat #32"
+               html: "<a X>0<b>1<a Y>2"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       x=\"\"\n|       \"0\"\n|       <b>\n|         \"1\"\n|     <b>\n|       <a>\n|         y=\"\"\n|         \"2\"\n"
+       }, {
+               name: "tests1.dat #33"
+               html: "<!-----><font><div>hello<table>excite!<b>me!<th><i>please!</tr><!--X-->"
+               errors: 16
+               expected: "| <!-- - -->\n| <html>\n|   <head>\n|   <body>\n|     <font>\n|       <div>\n|         \"helloexcite!\"\n|         <b>\n|           \"me!\"\n|         <table>\n|           <tbody>\n|             <tr>\n|               <th>\n|                 <i>\n|                   \"please!\"\n|             <!-- X -->\n"
+       }, {
+               name: "tests1.dat #34"
+               html: "<!DOCTYPE html><li>hello<li>world<ul>how<li>do</ul>you</body><!--do-->"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <li>\n|       \"hello\"\n|     <li>\n|       \"world\"\n|       <ul>\n|         \"how\"\n|         <li>\n|           \"do\"\n|       \"you\"\n|   <!-- do -->\n"
+       }, {
+               name: "tests1.dat #35"
+               html: "<!DOCTYPE html>A<option>B<optgroup>C<select>D</option>E"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"A\"\n|     <option>\n|       \"B\"\n|     <optgroup>\n|       \"C\"\n|       <select>\n|         \"DE\"\n"
+       }, {
+               name: "tests1.dat #36"
+               html: "<"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"<\"\n"
+       }, {
+               name: "tests1.dat #37"
+               html: "<#"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"<#\"\n"
+       }, {
+               name: "tests1.dat #38"
+               html: "</"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"</\"\n"
+       }, {
+               name: "tests1.dat #39"
+               html: "</#"
+               errors: 2
+               expected: "| <!-- # -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #40"
+               html: "<?"
+               errors: 2
+               expected: "| <!-- ? -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #41"
+               html: "<?#"
+               errors: 2
+               expected: "| <!-- ?# -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #42"
+               html: "<!"
+               errors: 2
+               expected: "| <!--  -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #43"
+               html: "<!#"
+               errors: 2
+               expected: "| <!-- # -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #44"
+               html: "<?COMMENT?>"
+               errors: 2
+               expected: "| <!-- ?COMMENT? -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #45"
+               html: "<!COMMENT>"
+               errors: 2
+               expected: "| <!-- COMMENT -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #46"
+               html: "</ COMMENT >"
+               errors: 2
+               expected: "| <!--  COMMENT  -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #47"
+               html: "<?COM--MENT?>"
+               errors: 2
+               expected: "| <!-- ?COM--MENT? -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #48"
+               html: "<!COM--MENT>"
+               errors: 2
+               expected: "| <!-- COM--MENT -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #49"
+               html: "</ COM--MENT >"
+               errors: 2
+               expected: "| <!--  COM--MENT  -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #50"
+               html: "<!DOCTYPE html><style> EOF"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \" EOF\"\n|   <body>\n"
+       }, {
+               name: "tests1.dat #51"
+               html: "<!DOCTYPE html><script> <!-- </script> --> </script> EOF"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \" <!-- \"\n|     \" \"\n|   <body>\n|     \"-->  EOF\"\n"
+       }, {
+               name: "tests1.dat #52"
+               html: "<b><p></b>TEST"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|     <p>\n|       <b>\n|       \"TEST\"\n"
+       }, {
+               name: "tests1.dat #53"
+               html: "<p id=a><b><p id=b></b>TEST"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       id=\"a\"\n|       <b>\n|     <p>\n|       id=\"b\"\n|       \"TEST\"\n"
+       }, {
+               name: "tests1.dat #54"
+               html: "<b id=a><p><b id=b></p></b>TEST"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       id=\"a\"\n|       <p>\n|         <b>\n|           id=\"b\"\n|       \"TEST\"\n"
+       }, {
+               name: "tests1.dat #55"
+               html: "<!DOCTYPE html><title>U-test</title><body><div><p>Test<u></p></div></body>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"U-test\"\n|   <body>\n|     <div>\n|       <p>\n|         \"Test\"\n|         <u>\n"
+       }, {
+               name: "tests1.dat #56"
+               html: "<!DOCTYPE html><font><table></font></table></font>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <font>\n|       <table>\n"
+       }, {
+               name: "tests1.dat #57"
+               html: "<font><p>hello<b>cruel</font>world"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <font>\n|     <p>\n|       <font>\n|         \"hello\"\n|         <b>\n|           \"cruel\"\n|       <b>\n|         \"world\"\n"
+       }, {
+               name: "tests1.dat #58"
+               html: "<b>Test</i>Test"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"TestTest\"\n"
+       }, {
+               name: "tests1.dat #59"
+               html: "<b>A<cite>B<div>C"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"A\"\n|       <cite>\n|         \"B\"\n|         <div>\n|           \"C\"\n"
+       }, {
+               name: "tests1.dat #60"
+               html: "<b>A<cite>B<div>C</cite>D"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"A\"\n|       <cite>\n|         \"B\"\n|         <div>\n|           \"CD\"\n"
+       }, {
+               name: "tests1.dat #61"
+               html: "<b>A<cite>B<div>C</b>D"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"A\"\n|       <cite>\n|         \"B\"\n|     <div>\n|       <b>\n|         \"C\"\n|       \"D\"\n"
+       }, {
+               name: "tests1.dat #62"
+               html: ""
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #63"
+               html: "<DIV>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n"
+       }, {
+               name: "tests1.dat #64"
+               html: "<DIV> abc"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc\"\n"
+       }, {
+               name: "tests1.dat #65"
+               html: "<DIV> abc <B>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n"
+       }, {
+               name: "tests1.dat #66"
+               html: "<DIV> abc <B> def"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def\"\n"
+       }, {
+               name: "tests1.dat #67"
+               html: "<DIV> abc <B> def <I>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n"
+       }, {
+               name: "tests1.dat #68"
+               html: "<DIV> abc <B> def <I> ghi"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi\"\n"
+       }, {
+               name: "tests1.dat #69"
+               html: "<DIV> abc <B> def <I> ghi <P>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|           <p>\n"
+       }, {
+               name: "tests1.dat #70"
+               html: "<DIV> abc <B> def <I> ghi <P> jkl"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|           <p>\n|             \" jkl\"\n"
+       }, {
+               name: "tests1.dat #71"
+               html: "<DIV> abc <B> def <I> ghi <P> jkl </B>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|         <p>\n|           <b>\n|             \" jkl \"\n"
+       }, {
+               name: "tests1.dat #72"
+               html: "<DIV> abc <B> def <I> ghi <P> jkl </B> mno"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|         <p>\n|           <b>\n|             \" jkl \"\n|           \" mno\"\n"
+       }, {
+               name: "tests1.dat #73"
+               html: "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|       <p>\n|         <i>\n|           <b>\n|             \" jkl \"\n|           \" mno \"\n"
+       }, {
+               name: "tests1.dat #74"
+               html: "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|       <p>\n|         <i>\n|           <b>\n|             \" jkl \"\n|           \" mno \"\n|         \" pqr\"\n"
+       }, {
+               name: "tests1.dat #75"
+               html: "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|       <p>\n|         <i>\n|           <b>\n|             \" jkl \"\n|           \" mno \"\n|         \" pqr \"\n"
+       }, {
+               name: "tests1.dat #76"
+               html: "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P> stu"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|       <p>\n|         <i>\n|           <b>\n|             \" jkl \"\n|           \" mno \"\n|         \" pqr \"\n|       \" stu\"\n"
+       }, {
+               name: "tests1.dat #77"
+               html: "<test attribute---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <test>\n|       attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=\"\"\n"
+       }, {
+               name: "tests1.dat #78"
+               html: "<a href=\"blah\">aba<table><a href=\"foo\">br<tr><td></td></tr>x</table>aoe"
+               errors: 8
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"blah\"\n|       \"aba\"\n|       <a>\n|         href=\"foo\"\n|         \"br\"\n|       <a>\n|         href=\"foo\"\n|         \"x\"\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|     <a>\n|       href=\"foo\"\n|       \"aoe\"\n"
+       }, {
+               name: "tests1.dat #79"
+               html: "<a href=\"blah\">aba<table><tr><td><a href=\"foo\">br</td></tr>x</table>aoe"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"blah\"\n|       \"abax\"\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <a>\n|                 href=\"foo\"\n|                 \"br\"\n|       \"aoe\"\n"
+       }, {
+               name: "tests1.dat #80"
+               html: "<table><a href=\"blah\">aba<tr><td><a href=\"foo\">br</td></tr>x</table>aoe"
+               errors: 8
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"blah\"\n|       \"aba\"\n|     <a>\n|       href=\"blah\"\n|       \"x\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <a>\n|               href=\"foo\"\n|               \"br\"\n|     <a>\n|       href=\"blah\"\n|       \"aoe\"\n"
+       }, {
+               name: "tests1.dat #81"
+               html: "<a href=a>aa<marquee>aa<a href=b>bb</marquee>aa"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"a\"\n|       \"aa\"\n|       <marquee>\n|         \"aa\"\n|         <a>\n|           href=\"b\"\n|           \"bb\"\n|       \"aa\"\n"
+       }, {
+               name: "tests1.dat #82"
+               html: "<wbr><strike><code></strike><code><strike></code>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <wbr>\n|     <strike>\n|       <code>\n|     <code>\n|       <code>\n|         <strike>\n"
+       }, {
+               name: "tests1.dat #83"
+               html: "<!DOCTYPE html><spacer>foo"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <spacer>\n|       \"foo\"\n"
+       }, {
+               name: "tests1.dat #84"
+               html: "<title><meta></title><link><title><meta></title>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <title>\n|       \"<meta>\"\n|     <link>\n|     <title>\n|       \"<meta>\"\n|   <body>\n"
+       }, {
+               name: "tests1.dat #85"
+               html: "<style><!--</style><meta><script>--><link></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--\"\n|     <meta>\n|     <script>\n|       \"--><link>\"\n|   <body>\n"
+       }, {
+               name: "tests1.dat #86"
+               html: "<head><meta></head><link>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <meta>\n|     <link>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #87"
+               html: "<table><tr><tr><td><td><span><th><span>X</table>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|         <tr>\n|           <td>\n|           <td>\n|             <span>\n|           <th>\n|             <span>\n|               \"X\"\n"
+       }, {
+               name: "tests1.dat #88"
+               html: "<body><body><base><link><meta><title><p></title><body><p></body>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <base>\n|     <link>\n|     <meta>\n|     <title>\n|       \"<p>\"\n|     <p>\n"
+       }, {
+               name: "tests1.dat #89"
+               html: "<textarea><p></textarea>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<p>\"\n"
+       }, {
+               name: "tests1.dat #90"
+               html: "<p><image></p>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <img>\n"
+       }, {
+               name: "tests1.dat #91"
+               html: "<a><table><a></table><p><a><div><a>"
+               errors: 10
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <a>\n|       <table>\n|     <p>\n|       <a>\n|     <div>\n|       <a>\n"
+       }, {
+               name: "tests1.dat #92"
+               html: "<head></p><meta><p>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <meta>\n|   <body>\n|     <p>\n"
+       }, {
+               name: "tests1.dat #93"
+               html: "<head></html><meta><p>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <meta>\n|     <p>\n"
+       }, {
+               name: "tests1.dat #94"
+               html: "<b><table><td><i></table>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <i>\n"
+       }, {
+               name: "tests1.dat #95"
+               html: "<b><table><td></b><i></table>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <i>\n"
+       }, {
+               name: "tests1.dat #96"
+               html: "<h1><h2>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <h1>\n|     <h2>\n"
+       }, {
+               name: "tests1.dat #97"
+               html: "<a><p><a></a></p></a>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <p>\n|       <a>\n|       <a>\n"
+       }, {
+               name: "tests1.dat #98"
+               html: "<b><button></b></button></b>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|     <button>\n|       <b>\n"
+       }, {
+               name: "tests1.dat #99"
+               html: "<p><b><div><marquee></p></b></div>"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|     <div>\n|       <b>\n|         <marquee>\n|           <p>\n"
+       }, {
+               name: "tests1.dat #100"
+               html: "<script></script></div><title></title><p><p>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|     <title>\n|   <body>\n|     <p>\n|     <p>\n"
+       }, {
+               name: "tests1.dat #101"
+               html: "<p><hr></p>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <hr>\n|     <p>\n"
+       }, {
+               name: "tests1.dat #102"
+               html: "<select><b><option><select><option></b></select>"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|     <option>\n"
+       }, {
+               name: "tests1.dat #103"
+               html: "<html><head><title></title><body></body></html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <title>\n|   <body>\n"
+       }, {
+               name: "tests1.dat #104"
+               html: "<a><table><td><a><table></table><a></tr><a></table><a>"
+               errors: 10
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <a>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <a>\n|                 <table>\n|               <a>\n|     <a>\n"
+       }, {
+               name: "tests1.dat #105"
+               html: "<ul><li></li><div><li></div><li><li><div><li><address><li><b><em></b><li></ul>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ul>\n|       <li>\n|       <div>\n|         <li>\n|       <li>\n|       <li>\n|         <div>\n|       <li>\n|         <address>\n|       <li>\n|         <b>\n|           <em>\n|       <li>\n"
+       }, {
+               name: "tests1.dat #106"
+               html: "<ul><li><ul></li><li>a</li></ul></li></ul>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ul>\n|       <li>\n|         <ul>\n|           <li>\n|             \"a\"\n"
+       }, {
+               name: "tests1.dat #107"
+               html: "<frameset><frame><frameset><frame></frameset><noframes></noframes></frameset>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n|     <frameset>\n|       <frame>\n|     <noframes>\n"
+       }, {
+               name: "tests1.dat #108"
+               html: "<h1><table><td><h3></table><h3></h1>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <h1>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <h3>\n|     <h3>\n"
+       }, {
+               name: "tests1.dat #109"
+               html: "<table><colgroup><col><colgroup><col><col><col><colgroup><col><col><thead><tr><td></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <col>\n|       <colgroup>\n|         <col>\n|         <col>\n|         <col>\n|       <colgroup>\n|         <col>\n|         <col>\n|       <thead>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "tests1.dat #110"
+               html: "<table><col><tbody><col><tr><col><td><col></table><col>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <col>\n|       <tbody>\n|       <colgroup>\n|         <col>\n|       <tbody>\n|         <tr>\n|       <colgroup>\n|         <col>\n|       <tbody>\n|         <tr>\n|           <td>\n|       <colgroup>\n|         <col>\n"
+       }, {
+               name: "tests1.dat #111"
+               html: "<table><colgroup><tbody><colgroup><tr><colgroup><td><colgroup></table><colgroup>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|       <tbody>\n|       <colgroup>\n|       <tbody>\n|         <tr>\n|       <colgroup>\n|       <tbody>\n|         <tr>\n|           <td>\n|       <colgroup>\n"
+       }, {
+               name: "tests1.dat #112"
+               html: "</strong></b></em></i></u></strike></s></blink></tt></pre></big></small></font></select></h1></h2></h3></h4></h5></h6></body></br></a></img></title></span></style></script></table></th></td></tr></frame></area></link></param></hr></input></col></base></meta></basefont></bgsound></embed></spacer></p></dd></dt></caption></colgroup></tbody></tfoot></thead></address></blockquote></center></dir></div></dl></fieldset></listing></menu></ol></ul></li></nobr></wbr></form></button></marquee></object></html></frameset></head></iframe></image></isindex></noembed></noframes></noscript></optgroup></option></plaintext></textarea>"
+               errors: 85
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <br>\n|     <p>\n"
+       }, {
+               name: "tests1.dat #113"
+               html: "<table><tr></strong></b></em></i></u></strike></s></blink></tt></pre></big></small></font></select></h1></h2></h3></h4></h5></h6></body></br></a></img></title></span></style></script></table></th></td></tr></frame></area></link></param></hr></input></col></base></meta></basefont></bgsound></embed></spacer></p></dd></dt></caption></colgroup></tbody></tfoot></thead></address></blockquote></center></dir></div></dl></fieldset></listing></menu></ol></ul></li></nobr></wbr></form></button></marquee></object></html></frameset></head></iframe></image></isindex></noembed></noframes></noscript></optgroup></option></plaintext></textarea>"
+               errors: 111
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <br>\n|     <table>\n|       <tbody>\n|         <tr>\n|     <p>\n"
+       }, {
+               name: "tests1.dat #114"
+               html: "<frameset>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests20.dat #1"
+               html: "<!doctype html><p><button><button>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|       <button>\n"
+       }, {
+               name: "tests20.dat #2"
+               html: "<!doctype html><p><button><address>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <address>\n"
+       }, {
+               name: "tests20.dat #3"
+               html: "<!doctype html><p><button><blockquote>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <blockquote>\n"
+       }, {
+               name: "tests20.dat #4"
+               html: "<!doctype html><p><button><menu>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <menu>\n"
+       }, {
+               name: "tests20.dat #5"
+               html: "<!doctype html><p><button><p>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <p>\n"
+       }, {
+               name: "tests20.dat #6"
+               html: "<!doctype html><p><button><ul>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <ul>\n"
+       }, {
+               name: "tests20.dat #7"
+               html: "<!doctype html><p><button><h1>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <h1>\n"
+       }, {
+               name: "tests20.dat #8"
+               html: "<!doctype html><p><button><h6>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <h6>\n"
+       }, {
+               name: "tests20.dat #9"
+               html: "<!doctype html><p><button><listing>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <listing>\n"
+       }, {
+               name: "tests20.dat #10"
+               html: "<!doctype html><p><button><pre>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <pre>\n"
+       }, {
+               name: "tests20.dat #11"
+               html: "<!doctype html><p><button><form>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <form>\n"
+       }, {
+               name: "tests20.dat #12"
+               html: "<!doctype html><p><button><li>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <li>\n"
+       }, {
+               name: "tests20.dat #13"
+               html: "<!doctype html><p><button><dd>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <dd>\n"
+       }, {
+               name: "tests20.dat #14"
+               html: "<!doctype html><p><button><dt>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <dt>\n"
+       }, {
+               name: "tests20.dat #15"
+               html: "<!doctype html><p><button><plaintext>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <plaintext>\n"
+       }, {
+               name: "tests20.dat #16"
+               html: "<!doctype html><p><button><table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <table>\n"
+       }, {
+               name: "tests20.dat #17"
+               html: "<!doctype html><p><button><hr>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <hr>\n"
+       }, {
+               name: "tests20.dat #18"
+               html: "<!doctype html><p><button><xmp>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <xmp>\n"
+       }, {
+               name: "tests20.dat #19"
+               html: "<!doctype html><p><button></p>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <p>\n"
+       }, {
+               name: "tests20.dat #20"
+               html: "<!doctype html><address><button></address>a"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <address>\n|       <button>\n|     \"a\"\n"
+       }, {
+               name: "tests20.dat #21"
+               html: "<!doctype html><address><button></address>a"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <address>\n|       <button>\n|     \"a\"\n"
+       }, {
+               name: "tests20.dat #22"
+               html: "<p><table></p>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <p>\n|       <table>\n"
+       }, {
+               name: "tests20.dat #23"
+               html: "<!doctype html><svg>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
+       }, {
+               name: "tests20.dat #24"
+               html: "<!doctype html><p><figcaption>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <figcaption>\n"
+       }, {
+               name: "tests20.dat #25"
+               html: "<!doctype html><p><summary>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <summary>\n"
+       }, {
+               name: "tests20.dat #26"
+               html: "<!doctype html><form><table><form>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <table>\n"
+       }, {
+               name: "tests20.dat #27"
+               html: "<!doctype html><table><form><form>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <form>\n"
+       }, {
+               name: "tests20.dat #28"
+               html: "<!doctype html><table><form></table><form>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <form>\n"
+       }, {
+               name: "tests20.dat #29"
+               html: "<!doctype html><svg><foreignObject><p>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|         <p>\n"
+       }, {
+               name: "tests20.dat #30"
+               html: "<!doctype html><svg><title>abc"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg title>\n|         \"abc\"\n"
+       }, {
+               name: "tests20.dat #31"
+               html: "<option><span><option>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <option>\n|       <span>\n|         <option>\n"
+       }, {
+               name: "tests20.dat #32"
+               html: "<option><option>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <option>\n|     <option>\n"
+       }, {
+               name: "tests20.dat #33"
+               html: "<math><annotation-xml><div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|     <div>\n"
+       }, {
+               name: "tests20.dat #34"
+               html: "<math><annotation-xml encoding=\"application/svg+xml\"><div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\"application/svg+xml\"\n|     <div>\n"
+       }, {
+               name: "tests20.dat #35"
+               html: "<math><annotation-xml encoding=\"application/xhtml+xml\"><div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\"application/xhtml+xml\"\n|         <div>\n"
+       }, {
+               name: "tests20.dat #36"
+               html: "<math><annotation-xml encoding=\"aPPlication/xhtmL+xMl\"><div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\"aPPlication/xhtmL+xMl\"\n|         <div>\n"
+       }, {
+               name: "tests20.dat #37"
+               html: "<math><annotation-xml encoding=\"text/html\"><div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\"text/html\"\n|         <div>\n"
+       }, {
+               name: "tests20.dat #38"
+               html: "<math><annotation-xml encoding=\"Text/htmL\"><div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\"Text/htmL\"\n|         <div>\n"
+       }, {
+               name: "tests20.dat #39"
+               html: "<math><annotation-xml encoding=\" text/html \"><div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\" text/html \"\n|     <div>\n"
+       }, {
+               name: "tests21.dat #1"
+               html: "<svg><![CDATA[foo]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\"\n"
+       }, {
+               name: "tests21.dat #2"
+               html: "<math><![CDATA[foo]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       \"foo\"\n"
+       }, {
+               name: "tests21.dat #3"
+               html: "<div><![CDATA[foo]]>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <!-- [CDATA[foo]] -->\n"
+       }, {
+               name: "tests21.dat #4"
+               html: "<svg><![CDATA[foo"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\"\n"
+       }, {
+               name: "tests21.dat #5"
+               html: "<svg><![CDATA[foo"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\"\n"
+       }, {
+               name: "tests21.dat #6"
+               html: "<svg><![CDATA["
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
+       }, {
+               name: "tests21.dat #7"
+               html: "<svg><![CDATA[]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
+       }, {
+               name: "tests21.dat #8"
+               html: "<svg><![CDATA[]] >]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"]] >\"\n"
+       }, {
+               name: "tests21.dat #9"
+               html: "<svg><![CDATA[]] >]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"]] >\"\n"
+       }, {
+               name: "tests21.dat #10"
+               html: "<svg><![CDATA[]]"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"]]\"\n"
+       }, {
+               name: "tests21.dat #11"
+               html: "<svg><![CDATA[]"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"]\"\n"
+       }, {
+               name: "tests21.dat #12"
+               html: "<svg><![CDATA[]>a"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"]>a\"\n"
+       }, {
+               name: "tests21.dat #13"
+               html: "<!DOCTYPE html><svg><![CDATA[foo]]]>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo]\"\n"
+       }, {
+               name: "tests21.dat #14"
+               html: "<!DOCTYPE html><svg><![CDATA[foo]]]]>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo]]\"\n"
+       }, {
+               name: "tests21.dat #15"
+               html: "<!DOCTYPE html><svg><![CDATA[foo]]]]]>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo]]]\"\n"
+       }, {
+               name: "tests21.dat #16"
+               html: "<svg><foreignObject><div><![CDATA[foo]]>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|         <div>\n|           <!-- [CDATA[foo]] -->\n"
+       }, {
+               name: "tests21.dat #17"
+               html: "<svg><![CDATA[<svg>]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>\"\n"
+       }, {
+               name: "tests21.dat #18"
+               html: "<svg><![CDATA[</svg>a]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"</svg>a\"\n"
+       }, {
+               name: "tests21.dat #19"
+               html: "<svg><![CDATA[<svg>a"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>a\"\n"
+       }, {
+               name: "tests21.dat #20"
+               html: "<svg><![CDATA[</svg>a"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"</svg>a\"\n"
+       }, {
+               name: "tests21.dat #21"
+               html: "<svg><![CDATA[<svg>]]><path>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>\"\n|       <svg path>\n"
+       }, {
+               name: "tests21.dat #22"
+               html: "<svg><![CDATA[<svg>]]></path>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>\"\n"
+       }, {
+               name: "tests21.dat #23"
+               html: "<svg><![CDATA[<svg>]]><!--path-->"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>\"\n|       <!-- path -->\n"
+       }, {
+               name: "tests21.dat #24"
+               html: "<svg><![CDATA[<svg>]]>path"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>path\"\n"
+       }, {
+               name: "tests21.dat #25"
+               html: "<svg><![CDATA[<!--svg-->]]>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<!--svg-->\"\n"
+       }, {
+               name: "tests22.dat #1"
+               html: "<a><b><big><em><strong><div>X</a>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|         <big>\n|           <em>\n|             <strong>\n|     <big>\n|       <em>\n|         <strong>\n|           <div>\n|             <a>\n|               \"X\"\n"
+       }, {
+               name: "tests22.dat #2"
+               html: "<a><b><div id=1><div id=2><div id=3><div id=4><div id=5><div id=6><div id=7><div id=8>A</a>"
+               errors: 10
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|     <b>\n|       <div>\n|         id=\"1\"\n|         <a>\n|         <div>\n|           id=\"2\"\n|           <a>\n|           <div>\n|             id=\"3\"\n|             <a>\n|             <div>\n|               id=\"4\"\n|               <a>\n|               <div>\n|                 id=\"5\"\n|                 <a>\n|                 <div>\n|                   id=\"6\"\n|                   <a>\n|                   <div>\n|                     id=\"7\"\n|                     <a>\n|                     <div>\n|                       id=\"8\"\n|                       <a>\n|                         \"A\"\n"
+       }, {
+               name: "tests22.dat #3"
+               html: "<a><b><div id=1><div id=2><div id=3><div id=4><div id=5><div id=6><div id=7><div id=8><div id=9>A</a>"
+               errors: 10
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|     <b>\n|       <div>\n|         id=\"1\"\n|         <a>\n|         <div>\n|           id=\"2\"\n|           <a>\n|           <div>\n|             id=\"3\"\n|             <a>\n|             <div>\n|               id=\"4\"\n|               <a>\n|               <div>\n|                 id=\"5\"\n|                 <a>\n|                 <div>\n|                   id=\"6\"\n|                   <a>\n|                   <div>\n|                     id=\"7\"\n|                     <a>\n|                     <div>\n|                       id=\"8\"\n|                       <a>\n|                         <div>\n|                           id=\"9\"\n|                           \"A\"\n"
+       }, {
+               name: "tests22.dat #4"
+               html: "<a><b><div id=1><div id=2><div id=3><div id=4><div id=5><div id=6><div id=7><div id=8><div id=9><div id=10>A</a>"
+               errors: 10
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|     <b>\n|       <div>\n|         id=\"1\"\n|         <a>\n|         <div>\n|           id=\"2\"\n|           <a>\n|           <div>\n|             id=\"3\"\n|             <a>\n|             <div>\n|               id=\"4\"\n|               <a>\n|               <div>\n|                 id=\"5\"\n|                 <a>\n|                 <div>\n|                   id=\"6\"\n|                   <a>\n|                   <div>\n|                     id=\"7\"\n|                     <a>\n|                     <div>\n|                       id=\"8\"\n|                       <a>\n|                         <div>\n|                           id=\"9\"\n|                           <div>\n|                             id=\"10\"\n|                             \"A\"\n"
+       }, {
+               name: "tests22.dat #5"
+               html: "<cite><b><cite><i><cite><i><cite><i><div>X</b>TEST"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <cite>\n|       <b>\n|         <cite>\n|           <i>\n|             <cite>\n|               <i>\n|                 <cite>\n|                   <i>\n|       <i>\n|         <i>\n|           <div>\n|             <b>\n|               \"X\"\n|             \"TEST\"\n"
+       }, {
+               name: "tests23.dat #1"
+               html: "<p><font size=4><font color=red><font size=4><font size=4><font size=4><font size=4><font size=4><font color=red><p>X"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <font>\n|         size=\"4\"\n|         <font>\n|           color=\"red\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"4\"\n|               <font>\n|                 size=\"4\"\n|                 <font>\n|                   size=\"4\"\n|                   <font>\n|                     size=\"4\"\n|                     <font>\n|                       color=\"red\"\n|     <p>\n|       <font>\n|         color=\"red\"\n|         <font>\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"4\"\n|               <font>\n|                 color=\"red\"\n|                 \"X\"\n"
+       }, {
+               name: "tests23.dat #2"
+               html: "<p><font size=4><font size=4><font size=4><font size=4><p>X"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <font>\n|         size=\"4\"\n|         <font>\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"4\"\n|     <p>\n|       <font>\n|         size=\"4\"\n|         <font>\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             \"X\"\n"
+       }, {
+               name: "tests23.dat #3"
+               html: "<p><font size=4><font size=4><font size=4><font size=\"5\"><font size=4><p>X"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <font>\n|         size=\"4\"\n|         <font>\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"5\"\n|               <font>\n|                 size=\"4\"\n|     <p>\n|       <font>\n|         size=\"4\"\n|         <font>\n|           size=\"4\"\n|           <font>\n|             size=\"5\"\n|             <font>\n|               size=\"4\"\n|               \"X\"\n"
+       }, {
+               name: "tests23.dat #4"
+               html: "<p><font size=4 id=a><font size=4 id=b><font size=4><font size=4><p>X"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <font>\n|         id=\"a\"\n|         size=\"4\"\n|         <font>\n|           id=\"b\"\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"4\"\n|     <p>\n|       <font>\n|         id=\"a\"\n|         size=\"4\"\n|         <font>\n|           id=\"b\"\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"4\"\n|               \"X\"\n"
+       }, {
+               name: "tests23.dat #5"
+               html: "<p><b id=a><b id=a><b id=a><b><object><b id=a><b id=a>X</object><p>Y"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|         id=\"a\"\n|         <b>\n|           id=\"a\"\n|           <b>\n|             id=\"a\"\n|             <b>\n|               <object>\n|                 <b>\n|                   id=\"a\"\n|                   <b>\n|                     id=\"a\"\n|                     \"X\"\n|     <p>\n|       <b>\n|         id=\"a\"\n|         <b>\n|           id=\"a\"\n|           <b>\n|             id=\"a\"\n|             <b>\n|               \"Y\"\n"
+       }, {
+               name: "tests24.dat #1"
+               html: "<!DOCTYPE html>&NotEqualTilde;"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"≂̸\"\n"
+       }, {
+               name: "tests24.dat #2"
+               html: "<!DOCTYPE html>&NotEqualTilde;A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"≂̸A\"\n"
+       }, {
+               name: "tests24.dat #3"
+               html: "<!DOCTYPE html>&ThickSpace;"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"  \"\n"
+       }, {
+               name: "tests24.dat #4"
+               html: "<!DOCTYPE html>&ThickSpace;A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"  A\"\n"
+       }, {
+               name: "tests24.dat #5"
+               html: "<!DOCTYPE html>&NotSubset;"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"⊂⃒\"\n"
+       }, {
+               name: "tests24.dat #6"
+               html: "<!DOCTYPE html>&NotSubset;A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"⊂⃒A\"\n"
+       }, {
+               name: "tests24.dat #7"
+               html: "<!DOCTYPE html>&Gopf;"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"𝔾\"\n"
+       }, {
+               name: "tests24.dat #8"
+               html: "<!DOCTYPE html>&Gopf;A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"𝔾A\"\n"
+       }, {
+               name: "tests25.dat #1"
+               html: "<!DOCTYPE html><body><foo>A"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       \"A\"\n"
+       }, {
+               name: "tests25.dat #2"
+               html: "<!DOCTYPE html><body><area>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <area>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #3"
+               html: "<!DOCTYPE html><body><base>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <base>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #4"
+               html: "<!DOCTYPE html><body><basefont>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <basefont>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #5"
+               html: "<!DOCTYPE html><body><bgsound>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <bgsound>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #6"
+               html: "<!DOCTYPE html><body><br>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <br>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #7"
+               html: "<!DOCTYPE html><body><col>A"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #8"
+               html: "<!DOCTYPE html><body><command>A"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <command>\n|       \"A\"\n"
+       }, {
+               name: "tests25.dat #9"
+               html: "<!DOCTYPE html><body><menuitem>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <menuitem>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #10"
+               html: "<!DOCTYPE html><body><embed>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <embed>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #11"
+               html: "<!DOCTYPE html><body><frame>A"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #12"
+               html: "<!DOCTYPE html><body><hr>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <hr>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #13"
+               html: "<!DOCTYPE html><body><img>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <img>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #14"
+               html: "<!DOCTYPE html><body><input>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <input>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #15"
+               html: "<!DOCTYPE html><body><keygen>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <keygen>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #16"
+               html: "<!DOCTYPE html><body><link>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <link>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #17"
+               html: "<!DOCTYPE html><body><meta>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <meta>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #18"
+               html: "<!DOCTYPE html><body><param>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <param>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #19"
+               html: "<!DOCTYPE html><body><source>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <source>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #20"
+               html: "<!DOCTYPE html><body><track>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <track>\n|     \"A\"\n"
+       }, {
+               name: "tests25.dat #21"
+               html: "<!DOCTYPE html><body><wbr>A"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <wbr>\n|     \"A\"\n"
+       }, {
+               name: "tests26.dat #1"
+               html: "<!DOCTYPE html><body><a href='#1'><nobr>1<nobr></a><br><a href='#2'><nobr>2<nobr></a><br><a href='#3'><nobr>3<nobr></a>"
+               errors: 10
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"#1\"\n|       <nobr>\n|         \"1\"\n|       <nobr>\n|     <nobr>\n|       <br>\n|       <a>\n|         href=\"#2\"\n|     <a>\n|       href=\"#2\"\n|       <nobr>\n|         \"2\"\n|       <nobr>\n|     <nobr>\n|       <br>\n|       <a>\n|         href=\"#3\"\n|     <a>\n|       href=\"#3\"\n|       <nobr>\n|         \"3\"\n|       <nobr>\n"
+       }, {
+               name: "tests26.dat #2"
+               html: "<!DOCTYPE html><body><b><nobr>1<nobr></b><i><nobr>2<nobr></i>3"
+               errors: 7
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|       <nobr>\n|     <nobr>\n|       <i>\n|     <i>\n|       <nobr>\n|         \"2\"\n|       <nobr>\n|     <nobr>\n|       \"3\"\n"
+       }, {
+               name: "tests26.dat #3"
+               html: "<!DOCTYPE html><body><b><nobr>1<table><nobr></b><i><nobr>2<nobr></i>3"
+               errors: 14
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|         <nobr>\n|           <i>\n|         <i>\n|           <nobr>\n|             \"2\"\n|           <nobr>\n|         <nobr>\n|           \"3\"\n|         <table>\n"
+       }, {
+               name: "tests26.dat #4"
+               html: "<!DOCTYPE html><body><b><nobr>1<table><tr><td><nobr></b><i><nobr>2<nobr></i>3"
+               errors: 6
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|         <table>\n|           <tbody>\n|             <tr>\n|               <td>\n|                 <nobr>\n|                   <i>\n|                 <i>\n|                   <nobr>\n|                     \"2\"\n|                   <nobr>\n|                 <nobr>\n|                   \"3\"\n"
+       }, {
+               name: "tests26.dat #5"
+               html: "<!DOCTYPE html><body><b><nobr>1<div><nobr></b><i><nobr>2<nobr></i>3"
+               errors: 9
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|     <div>\n|       <b>\n|         <nobr>\n|         <nobr>\n|       <nobr>\n|         <i>\n|       <i>\n|         <nobr>\n|           \"2\"\n|         <nobr>\n|       <nobr>\n|         \"3\"\n"
+       }, {
+               name: "tests26.dat #6"
+               html: "<!DOCTYPE html><body><b><nobr>1<nobr></b><div><i><nobr>2<nobr></i>3"
+               errors: 7
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|       <nobr>\n|     <div>\n|       <nobr>\n|         <i>\n|       <i>\n|         <nobr>\n|           \"2\"\n|         <nobr>\n|       <nobr>\n|         \"3\"\n"
+       }, {
+               name: "tests26.dat #7"
+               html: "<!DOCTYPE html><body><b><nobr>1<nobr><ins></b><i><nobr>"
+               errors: 5
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|       <nobr>\n|         <ins>\n|     <nobr>\n|       <i>\n|     <i>\n|       <nobr>\n"
+       }, {
+               name: "tests26.dat #8"
+               html: "<!DOCTYPE html><body><b><nobr>1<ins><nobr></b><i>2"
+               errors: 4
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|         <ins>\n|       <nobr>\n|     <nobr>\n|       <i>\n|         \"2\"\n"
+       }, {
+               name: "tests26.dat #9"
+               html: "<!DOCTYPE html><body><b>1<nobr></b><i><nobr>2</i>"
+               errors: 4
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"1\"\n|       <nobr>\n|     <nobr>\n|       <i>\n|     <i>\n|       <nobr>\n|         \"2\"\n"
+       }, {
+               name: "tests26.dat #10"
+               html: "<p><code x</code></p>\n"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <code>\n|         code=\"\"\n|         x<=\"\"\n|     <code>\n|       code=\"\"\n|       x<=\"\"\n|       \"\n\"\n"
+       }, {
+               name: "tests26.dat #11"
+               html: "<!DOCTYPE html><svg><foreignObject><p><i></p>a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|         <p>\n|           <i>\n|         <i>\n|           \"a\"\n"
+       }, {
+               name: "tests26.dat #12"
+               html: "<!DOCTYPE html><table><tr><td><svg><foreignObject><p><i></p>a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg foreignObject>\n|                 <p>\n|                   <i>\n|                 <i>\n|                   \"a\"\n"
+       }, {
+               name: "tests26.dat #13"
+               html: "<!DOCTYPE html><math><mtext><p><i></p>a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mtext>\n|         <p>\n|           <i>\n|         <i>\n|           \"a\"\n"
+       }, {
+               name: "tests26.dat #14"
+               html: "<!DOCTYPE html><table><tr><td><math><mtext><p><i></p>a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <math math>\n|               <math mtext>\n|                 <p>\n|                   <i>\n|                 <i>\n|                   \"a\"\n"
+       }, {
+               name: "tests26.dat #15"
+               html: "<!DOCTYPE html><body><div><!/div>a"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <!-- /div -->\n|       \"a\"\n"
+       }, {
+               name: "tests26.dat #16"
+               html: "<button><p><button>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <button>\n|       <p>\n|     <button>\n"
+       }, {
+               name: "tests2.dat #1"
+               html: "<!DOCTYPE html>Test"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"Test\"\n"
+       }, {
+               name: "tests2.dat #2"
+               html: "<textarea>test</div>test"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"test</div>test\"\n"
+       }, {
+               name: "tests2.dat #3"
+               html: "<table><td>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "tests2.dat #4"
+               html: "<table><td>test</tbody></table>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"test\"\n"
+       }, {
+               name: "tests2.dat #5"
+               html: "<frame>test"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"test\"\n"
+       }, {
+               name: "tests2.dat #6"
+               html: "<!DOCTYPE html><frameset>test"
+               errors: 5
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests2.dat #7"
+               html: "<!DOCTYPE html><frameset> te st"
+               errors: 5
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     \"  \"\n"
+       }, {
+               name: "tests2.dat #8"
+               html: "<!DOCTYPE html><frameset></frameset> te st"
+               errors: 4
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   \"  \"\n"
+       }, {
+               name: "tests2.dat #9"
+               html: "<!DOCTYPE html><frameset><!DOCTYPE html>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests2.dat #10"
+               html: "<!DOCTYPE html><font><p><b>test</font>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <font>\n|     <p>\n|       <font>\n|         <b>\n|           \"test\"\n"
+       }, {
+               name: "tests2.dat #11"
+               html: "<!DOCTYPE html><dt><div><dd>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <dt>\n|       <div>\n|     <dd>\n"
+       }, {
+               name: "tests2.dat #12"
+               html: "<script></x"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \"</x\"\n|   <body>\n"
+       }, {
+               name: "tests2.dat #13"
+               html: "<table><plaintext><td>"
+               errors: 7
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"<td>\"\n|     <table>\n"
+       }, {
+               name: "tests2.dat #14"
+               html: "<plaintext></plaintext>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"</plaintext>\"\n"
+       }, {
+               name: "tests2.dat #15"
+               html: "<!DOCTYPE html><table><tr>TEST"
+               errors: 5
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"TEST\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests2.dat #16"
+               html: "<!DOCTYPE html><body t1=1><body t2=2><body t3=3 t4=4>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     t1=\"1\"\n|     t2=\"2\"\n|     t3=\"3\"\n|     t4=\"4\"\n"
+       }, {
+               name: "tests2.dat #17"
+               html: "</b test"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests2.dat #18"
+               html: "<!DOCTYPE html></b test<b &=&amp>X"
+               errors: 4
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n"
+       }, {
+               name: "tests2.dat #19"
+               html: "<!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       type=\"text/x-foobar;baz\"\n|       \"X</SCRipt\"\n|   <body>\n"
+       }, {
+               name: "tests2.dat #20"
+               html: "&"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"&\"\n"
+       }, {
+               name: "tests2.dat #21"
+               html: "&#"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"&#\"\n"
+       }, {
+               name: "tests2.dat #22"
+               html: "&#X"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"&#X\"\n"
+       }, {
+               name: "tests2.dat #23"
+               html: "&#x"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"&#x\"\n"
+       }, {
+               name: "tests2.dat #24"
+               html: "&#45"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"-\"\n"
+       }, {
+               name: "tests2.dat #25"
+               html: "&x-test"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"&x-test\"\n"
+       }, {
+               name: "tests2.dat #26"
+               html: "<!doctypehtml><p><li>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <li>\n"
+       }, {
+               name: "tests2.dat #27"
+               html: "<!doctypehtml><p><dt>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <dt>\n"
+       }, {
+               name: "tests2.dat #28"
+               html: "<!doctypehtml><p><dd>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <dd>\n"
+       }, {
+               name: "tests2.dat #29"
+               html: "<!doctypehtml><p><form>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <form>\n"
+       }, {
+               name: "tests2.dat #30"
+               html: "<!DOCTYPE html><p></P>X"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     \"X\"\n"
+       }, {
+               name: "tests2.dat #31"
+               html: "&AMP"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"&\"\n"
+       }, {
+               name: "tests2.dat #32"
+               html: "&AMp;"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"&AMp;\"\n"
+       }, {
+               name: "tests2.dat #33"
+               html: "<!DOCTYPE html><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly>\n"
+       }, {
+               name: "tests2.dat #34"
+               html: "<!DOCTYPE html>X</body>X"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"XX\"\n"
+       }, {
+               name: "tests2.dat #35"
+               html: "<!DOCTYPE html><!-- X"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <!--  X -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests2.dat #36"
+               html: "<!DOCTYPE html><table><caption>test TEST</caption><td>test"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         \"test TEST\"\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"test\"\n"
+       }, {
+               name: "tests2.dat #37"
+               html: "<!DOCTYPE html><select><option><optgroup>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|       <optgroup>\n"
+       }, {
+               name: "tests2.dat #38"
+               html: "<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <optgroup>\n|         <option>\n|       <option>\n|     <option>\n"
+       }, {
+               name: "tests2.dat #39"
+               html: "<!DOCTYPE html><select><optgroup><option><optgroup>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <optgroup>\n|         <option>\n|       <optgroup>\n"
+       }, {
+               name: "tests2.dat #40"
+               html: "<!DOCTYPE html><datalist><option>foo</datalist>bar"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <datalist>\n|       <option>\n|         \"foo\"\n|     \"bar\"\n"
+       }, {
+               name: "tests2.dat #41"
+               html: "<!DOCTYPE html><font><input><input></font>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <font>\n|       <input>\n|       <input>\n"
+       }, {
+               name: "tests2.dat #42"
+               html: "<!DOCTYPE html><!-- XXX - XXX -->"
+               expected: "| <!DOCTYPE html>\n| <!--  XXX - XXX  -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests2.dat #43"
+               html: "<!DOCTYPE html><!-- XXX - XXX"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <!--  XXX - XXX -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests2.dat #44"
+               html: "<!DOCTYPE html><!-- XXX - XXX - XXX -->"
+               expected: "| <!DOCTYPE html>\n| <!--  XXX - XXX - XXX  -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests2.dat #45"
+               html: "<isindex test=x name=x>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <hr>\n|       <label>\n|         \"This is a searchable index. Enter search keywords: \"\n|         <input>\n|           name=\"isindex\"\n|           test=\"x\"\n|       <hr>\n"
+       }, {
+               name: "tests2.dat #46"
+               html: "test\ntest"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"test\ntest\"\n"
+       }, {
+               name: "tests2.dat #47"
+               html: "<!DOCTYPE html><body><title>test</body></title>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <title>\n|       \"test</body>\"\n"
+       }, {
+               name: "tests2.dat #48"
+               html: "<!DOCTYPE html><body><title>X</title><meta name=z><link rel=foo><style>\nx { content:\"</style\" } </style>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <title>\n|       \"X\"\n|     <meta>\n|       name=\"z\"\n|     <link>\n|       rel=\"foo\"\n|     <style>\n|       \"\nx { content:\"</style\" } \"\n"
+       }, {
+               name: "tests2.dat #49"
+               html: "<!DOCTYPE html><select><optgroup></optgroup></select>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <optgroup>\n"
+       }, {
+               name: "tests2.dat #50"
+               html: " \n "
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests2.dat #51"
+               html: "<!DOCTYPE html>  <html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests2.dat #52"
+               html: "<!DOCTYPE html><script>\n</script>  <title>x</title>  </head>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"\n\"\n|     \"  \"\n|     <title>\n|       \"x\"\n|     \"  \"\n|   <body>\n"
+       }, {
+               name: "tests2.dat #53"
+               html: "<!DOCTYPE html><html><body><html id=x>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   id=\"x\"\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests2.dat #54"
+               html: "<!DOCTYPE html>X</body><html id=\"x\">"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   id=\"x\"\n|   <head>\n|   <body>\n|     \"X\"\n"
+       }, {
+               name: "tests2.dat #55"
+               html: "<!DOCTYPE html><head><html id=x>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   id=\"x\"\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests2.dat #56"
+               html: "<!DOCTYPE html>X</html>X"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"XX\"\n"
+       }, {
+               name: "tests2.dat #57"
+               html: "<!DOCTYPE html>X</html> "
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X \"\n"
+       }, {
+               name: "tests2.dat #58"
+               html: "<!DOCTYPE html>X</html><p>X"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n|     <p>\n|       \"X\"\n"
+       }, {
+               name: "tests2.dat #59"
+               html: "<!DOCTYPE html>X<p/x/y/z>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n|     <p>\n|       x=\"\"\n|       y=\"\"\n|       z=\"\"\n"
+       }, {
+               name: "tests2.dat #60"
+               html: "<!DOCTYPE html><!--x--"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <!-- x -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests2.dat #61"
+               html: "<!DOCTYPE html><table><tr><td></p></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <p>\n"
+       }, {
+               name: "tests2.dat #62"
+               html: "<!DOCTYPE <!DOCTYPE HTML>><!--<!--x-->-->"
+               errors: 3
+               expected: "| <!DOCTYPE <!doctype>\n| <html>\n|   <head>\n|   <body>\n|     \">\"\n|     <!-- <!--x -->\n|     \"-->\"\n"
+       }, {
+               name: "tests2.dat #63"
+               html: "<!doctype html><div><form></form><div></div></div>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <form>\n|       <div>\n"
+       }, {
+               name: "tests3.dat #1"
+               html: "<head></head><style></style>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <style>\n|   <body>\n"
+       }, {
+               name: "tests3.dat #2"
+               html: "<head></head><script></script>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|   <body>\n"
+       }, {
+               name: "tests3.dat #3"
+               html: "<head></head><!-- --><style></style><!-- --><script></script>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|     <style>\n|     <script>\n|   <!--   -->\n|   <!--   -->\n|   <body>\n"
+       }, {
+               name: "tests3.dat #4"
+               html: "<head></head><!-- -->x<style></style><!-- --><script></script>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <!--   -->\n|   <body>\n|     \"x\"\n|     <style>\n|     <!--   -->\n|     <script>\n"
+       }, {
+               name: "tests3.dat #5"
+               html: "<!DOCTYPE html><html><head></head><body><pre>\n</pre></body></html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n"
+       }, {
+               name: "tests3.dat #6"
+               html: "<!DOCTYPE html><html><head></head><body><pre>\nfoo</pre></body></html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"foo\"\n"
+       }, {
+               name: "tests3.dat #7"
+               html: "<!DOCTYPE html><html><head></head><body><pre>\n\nfoo</pre></body></html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"\nfoo\"\n"
+       }, {
+               name: "tests3.dat #8"
+               html: "<!DOCTYPE html><html><head></head><body><pre>\nfoo\n</pre></body></html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"foo\n\"\n"
+       }, {
+               name: "tests3.dat #9"
+               html: "<!DOCTYPE html><html><head></head><body><pre>x</pre><span>\n</span></body></html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"x\"\n|     <span>\n|       \"\n\"\n"
+       }, {
+               name: "tests3.dat #10"
+               html: "<!DOCTYPE html><html><head></head><body><pre>x\ny</pre></body></html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"x\ny\"\n"
+       }, {
+               name: "tests3.dat #11"
+               html: "<!DOCTYPE html><html><head></head><body><pre>x<div>\ny</pre></body></html>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"x\"\n|       <div>\n|         \"\ny\"\n"
+       }, {
+               name: "tests3.dat #12"
+               html: "<!DOCTYPE html><pre>&#x0a;&#x0a;A</pre>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"\nA\"\n"
+       }, {
+               name: "tests3.dat #13"
+               html: "<!DOCTYPE html><HTML><META><HEAD></HEAD></HTML>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <meta>\n|   <body>\n"
+       }, {
+               name: "tests3.dat #14"
+               html: "<!DOCTYPE html><HTML><HEAD><head></HEAD></HTML>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests3.dat #15"
+               html: "<textarea>foo<span>bar</span><i>baz"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"foo<span>bar</span><i>baz\"\n"
+       }, {
+               name: "tests3.dat #16"
+               html: "<title>foo<span>bar</em><i>baz"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <title>\n|       \"foo<span>bar</em><i>baz\"\n|   <body>\n"
+       }, {
+               name: "tests3.dat #17"
+               html: "<!DOCTYPE html><textarea>\n</textarea>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n"
+       }, {
+               name: "tests3.dat #18"
+               html: "<!DOCTYPE html><textarea>\nfoo</textarea>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"foo\"\n"
+       }, {
+               name: "tests3.dat #19"
+               html: "<!DOCTYPE html><textarea>\n\nfoo</textarea>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"\nfoo\"\n"
+       }, {
+               name: "tests3.dat #20"
+               html: "<!DOCTYPE html><html><head></head><body><ul><li><div><p><li></ul></body></html>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ul>\n|       <li>\n|         <div>\n|           <p>\n|       <li>\n"
+       }, {
+               name: "tests3.dat #21"
+               html: "<!doctype html><nobr><nobr><nobr>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <nobr>\n|     <nobr>\n|     <nobr>\n"
+       }, {
+               name: "tests3.dat #22"
+               html: "<!doctype html><nobr><nobr></nobr><nobr>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <nobr>\n|     <nobr>\n|     <nobr>\n"
+       }, {
+               name: "tests3.dat #23"
+               html: "<!doctype html><html><body><p><table></table></body></html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <table>\n"
+       }, {
+               name: "tests3.dat #24"
+               html: "<p><table></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <table>\n"
+       }, {
+               name: "tests4.dat #1"
+               html: "direct div content"
+               fragment: "div"
+               expected: "| \"direct div content\"\n"
+       }, {
+               name: "tests4.dat #2"
+               html: "direct textarea content"
+               fragment: "textarea"
+               expected: "| \"direct textarea content\"\n"
+       }, {
+               name: "tests4.dat #3"
+               html: "textarea content with <em>pseudo</em> <foo>markup"
+               fragment: "textarea"
+               expected: "| \"textarea content with <em>pseudo</em> <foo>markup\"\n"
+       }, {
+               name: "tests4.dat #4"
+               html: "this is &#x0043;DATA inside a <style> element"
+               fragment: "style"
+               expected: "| \"this is &#x0043;DATA inside a <style> element\"\n"
+       }, {
+               name: "tests4.dat #5"
+               html: "</plaintext>"
+               fragment: "plaintext"
+               expected: "| \"</plaintext>\"\n"
+       }, {
+               name: "tests4.dat #6"
+               html: "setting html's innerHTML"
+               fragment: "html"
+               expected: "| <head>\n| <body>\n|   \"setting html's innerHTML\"\n"
+       }, {
+               name: "tests4.dat #7"
+               html: "<title>setting head's innerHTML</title>"
+               fragment: "head"
+               expected: "| <title>\n|   \"setting head's innerHTML\"\n"
+       }, {
+               name: "tests5.dat #1"
+               html: "<style> <!-- </style>x"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \" <!-- \"\n|   <body>\n|     \"x\"\n"
+       }, {
+               name: "tests5.dat #2"
+               html: "<style> <!-- </style> --> </style>x"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \" <!-- \"\n|     \" \"\n|   <body>\n|     \"--> x\"\n"
+       }, {
+               name: "tests5.dat #3"
+               html: "<style> <!--> </style>x"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \" <!--> \"\n|   <body>\n|     \"x\"\n"
+       }, {
+               name: "tests5.dat #4"
+               html: "<style> <!---> </style>x"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \" <!---> \"\n|   <body>\n|     \"x\"\n"
+       }, {
+               name: "tests5.dat #5"
+               html: "<iframe> <!---> </iframe>x"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \" <!---> \"\n|     \"x\"\n"
+       }, {
+               name: "tests5.dat #6"
+               html: "<iframe> <!--- </iframe>->x</iframe> --> </iframe>x"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \" <!--- \"\n|     \"->x --> x\"\n"
+       }, {
+               name: "tests5.dat #7"
+               html: "<script> <!-- </script> --> </script>x"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <script>\n|       \" <!-- \"\n|     \" \"\n|   <body>\n|     \"--> x\"\n"
+       }, {
+               name: "tests5.dat #8"
+               html: "<title> <!-- </title> --> </title>x"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <title>\n|       \" <!-- \"\n|     \" \"\n|   <body>\n|     \"--> x\"\n"
+       }, {
+               name: "tests5.dat #9"
+               html: "<textarea> <!--- </textarea>->x</textarea> --> </textarea>x"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \" <!--- \"\n|     \"->x --> x\"\n"
+       }, {
+               name: "tests5.dat #10"
+               html: "<style> <!</-- </style>x"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <style>\n|       \" <!</-- \"\n|   <body>\n|     \"x\"\n"
+       }, {
+               name: "tests5.dat #11"
+               html: "<p><xmp></xmp>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <xmp>\n"
+       }, {
+               name: "tests5.dat #12"
+               html: "<xmp> <!-- > --> </xmp>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <xmp>\n|       \" <!-- > --> \"\n"
+       }, {
+               name: "tests5.dat #13"
+               html: "<title>&amp;</title>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <title>\n|       \"&\"\n|   <body>\n"
+       }, {
+               name: "tests5.dat #14"
+               html: "<title><!--&amp;--></title>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <title>\n|       \"<!--&-->\"\n|   <body>\n"
+       }, {
+               name: "tests5.dat #15"
+               html: "<title><!--</title>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <title>\n|       \"<!--\"\n|   <body>\n"
+       }, {
+               name: "tests5.dat #16"
+               html: "<noscript><!--</noscript>--></noscript>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <noscript>\n|       \"<!--\"\n|   <body>\n|     \"-->\"\n"
+       }, {
+               name: "tests5.dat #17"
+               html: "<noscript><!--</noscript>--></noscript>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|     <noscript>\n|       <!-- </noscript> -->\n|   <body>\n"
+       }, {
+               name: "tests6.dat #1"
+               html: "<!doctype html></head> <head>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   \" \"\n|   <body>\n"
+       }, {
+               name: "tests6.dat #2"
+               html: "<!doctype html><form><div></form><div>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <div>\n|         <div>\n"
+       }, {
+               name: "tests6.dat #3"
+               html: "<!doctype html><title>&amp;</title>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"&\"\n|   <body>\n"
+       }, {
+               name: "tests6.dat #4"
+               html: "<!doctype html><title><!--&amp;--></title>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"<!--&-->\"\n|   <body>\n"
+       }, {
+               name: "tests6.dat #5"
+               html: "<!doctype>"
+               errors: 3
+               expected: "| <!DOCTYPE >\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests6.dat #6"
+               html: "<!---x"
+               errors: 2
+               expected: "| <!-- -x -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests6.dat #7"
+               html: "<body>\n<div>"
+               errors: 2,"document-fragment":"div"
+               expected: "| \"\n\"\n| <div>\n"
+       }, {
+               name: "tests6.dat #8"
+               html: "<frameset></frameset>\nfoo"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <frameset>\n|   \"\n\"\n"
+       }, {
+               name: "tests6.dat #9"
+               html: "<frameset></frameset>\n<noframes>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n|   \"\n\"\n|   <noframes>\n"
+       }, {
+               name: "tests6.dat #10"
+               html: "<frameset></frameset>\n<div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n|   \"\n\"\n"
+       }, {
+               name: "tests6.dat #11"
+               html: "<frameset></frameset>\n</html>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <frameset>\n|   \"\n\"\n"
+       }, {
+               name: "tests6.dat #12"
+               html: "<frameset></frameset>\n</div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n|   \"\n\"\n"
+       }, {
+               name: "tests6.dat #13"
+               html: "<form><form>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <form>\n"
+       }, {
+               name: "tests6.dat #14"
+               html: "<button><button>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <button>\n|     <button>\n"
+       }, {
+               name: "tests6.dat #15"
+               html: "<table><tr><td></th>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "tests6.dat #16"
+               html: "<table><caption><td>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|       <tbody>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "tests6.dat #17"
+               html: "<table><caption><div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <div>\n"
+       }, {
+               name: "tests6.dat #18"
+               html: "</caption><div>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <div>\n"
+       }, {
+               name: "tests6.dat #19"
+               html: "<table><caption><div></caption>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <div>\n"
+       }, {
+               name: "tests6.dat #20"
+               html: "<table><caption></table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n"
+       }, {
+               name: "tests6.dat #21"
+               html: "</table><div>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <div>\n"
+       }, {
+               name: "tests6.dat #22"
+               html: "<table><caption></body></col></colgroup></html></tbody></td></tfoot></th></thead></tr>"
+               errors: 12
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n"
+       }, {
+               name: "tests6.dat #23"
+               html: "<table><caption><div></div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <div>\n"
+       }, {
+               name: "tests6.dat #24"
+               html: "<table><tr><td></body></caption></col></colgroup></html>"
+               errors: 7
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "tests6.dat #25"
+               html: "</table></tbody></tfoot></thead></tr><div>"
+               errors: 6,"document-fragment":"td"
+               expected: "| <div>\n"
+       }, {
+               name: "tests6.dat #26"
+               html: "<table><colgroup>foo"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"foo\"\n|     <table>\n|       <colgroup>\n"
+       }, {
+               name: "tests6.dat #27"
+               html: "foo<col>"
+               errors: 3,"document-fragment":"colgroup"
+               expected: "| <col>\n"
+       }, {
+               name: "tests6.dat #28"
+               html: "<table><colgroup></col>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n"
+       }, {
+               name: "tests6.dat #29"
+               html: "<frameset><div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests6.dat #30"
+               html: "</frameset><frame>"
+               errors: 1,"document-fragment":"frameset"
+               expected: "| <frame>\n"
+       }, {
+               name: "tests6.dat #31"
+               html: "<frameset></div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests6.dat #32"
+               html: "</body><div>"
+               errors: 2,"document-fragment":"body"
+               expected: "| <div>\n"
+       }, {
+               name: "tests6.dat #33"
+               html: "<table><tr><div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests6.dat #34"
+               html: "</tr><td>"
+               errors: 1,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests6.dat #35"
+               html: "</tbody></tfoot></thead><td>"
+               errors: 3,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests6.dat #36"
+               html: "<table><tr><div><td>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "tests6.dat #37"
+               html: "<caption><col><colgroup><tbody><tfoot><thead><tr>"
+               errors: 6,"document-fragment":"tbody"
+               expected: "| <tr>\n"
+       }, {
+               name: "tests6.dat #38"
+               html: "<table><tbody></thead>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n"
+       }, {
+               name: "tests6.dat #39"
+               html: "</table><tr>"
+               errors: 1,"document-fragment":"tbody"
+               expected: "| <tr>\n"
+       }, {
+               name: "tests6.dat #40"
+               html: "<table><tbody></body></caption></col></colgroup></html></td></th></tr>"
+               errors: 10
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n"
+       }, {
+               name: "tests6.dat #41"
+               html: "<table><tbody></div>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n"
+       }, {
+               name: "tests6.dat #42"
+               html: "<table><table>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|     <table>\n"
+       }, {
+               name: "tests6.dat #43"
+               html: "<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr>"
+               errors: 13
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n"
+       }, {
+               name: "tests6.dat #44"
+               html: "</table><tr>"
+               errors: 1,"document-fragment":"table"
+               expected: "| <tbody>\n|   <tr>\n"
+       }, {
+               name: "tests6.dat #45"
+               html: "<body></body></html>"
+               errors: 1,"document-fragment":"html"
+               expected: "| <head>\n| <body>\n"
+       }, {
+               name: "tests6.dat #46"
+               html: "<html><frameset></frameset></html> "
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <frameset>\n|   \" \"\n"
+       }, {
+               name: "tests6.dat #47"
+               html: "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"><html></html>"
+               expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"\">\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests6.dat #48"
+               html: "<param><frameset></frameset>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests6.dat #49"
+               html: "<source><frameset></frameset>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests6.dat #50"
+               html: "<track><frameset></frameset>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests6.dat #51"
+               html: "</html><frameset></frameset>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests6.dat #52"
+               html: "</body><frameset></frameset>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests7.dat #1"
+               html: "<!doctype html><body><title>X</title>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <title>\n|       \"X\"\n"
+       }, {
+               name: "tests7.dat #2"
+               html: "<!doctype html><table><title>X</title></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <title>\n|       \"X\"\n|     <table>\n"
+       }, {
+               name: "tests7.dat #3"
+               html: "<!doctype html><head></head><title>X</title>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"X\"\n|   <body>\n"
+       }, {
+               name: "tests7.dat #4"
+               html: "<!doctype html></head><title>X</title>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"X\"\n|   <body>\n"
+       }, {
+               name: "tests7.dat #5"
+               html: "<!doctype html><table><meta></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <meta>\n|     <table>\n"
+       }, {
+               name: "tests7.dat #6"
+               html: "<!doctype html><table>X<tr><td><table> <meta></table></table>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <meta>\n|             <table>\n|               \" \"\n"
+       }, {
+               name: "tests7.dat #7"
+               html: "<!doctype html><html> <head>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests7.dat #8"
+               html: "<!doctype html> <head>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests7.dat #9"
+               html: "<!doctype html><table><style> <tr>x </style> </table>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <style>\n|         \" <tr>x \"\n|       \" \"\n"
+       }, {
+               name: "tests7.dat #10"
+               html: "<!doctype html><table><TBODY><script> <tr>x </script> </table>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <script>\n|           \" <tr>x \"\n|         \" \"\n"
+       }, {
+               name: "tests7.dat #11"
+               html: "<!doctype html><p><applet><p>X</p></applet>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <applet>\n|         <p>\n|           \"X\"\n"
+       }, {
+               name: "tests7.dat #12"
+               html: "<!doctype html><p><object type=\"application/x-non-existant-plugin\"><p>X</p></object>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <object>\n|         type=\"application/x-non-existant-plugin\"\n|         <p>\n|           \"X\"\n"
+       }, {
+               name: "tests7.dat #13"
+               html: "<!doctype html><listing>\nX</listing>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <listing>\n|       \"X\"\n"
+       }, {
+               name: "tests7.dat #14"
+               html: "<!doctype html><select><input>X"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <input>\n|     \"X\"\n"
+       }, {
+               name: "tests7.dat #15"
+               html: "<!doctype html><select><select>X"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|     \"X\"\n"
+       }, {
+               name: "tests7.dat #16"
+               html: "<!doctype html><table><input type=hidDEN></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <input>\n|         type=\"hidDEN\"\n"
+       }, {
+               name: "tests7.dat #17"
+               html: "<!doctype html><table>X<input type=hidDEN></table>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n|     <table>\n|       <input>\n|         type=\"hidDEN\"\n"
+       }, {
+               name: "tests7.dat #18"
+               html: "<!doctype html><table>  <input type=hidDEN></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       \"  \"\n|       <input>\n|         type=\"hidDEN\"\n"
+       }, {
+               name: "tests7.dat #19"
+               html: "<!doctype html><table>  <input type='hidDEN'></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       \"  \"\n|       <input>\n|         type=\"hidDEN\"\n"
+       }, {
+               name: "tests7.dat #20"
+               html: "<!doctype html><table><input type=\" hidden\"><input type=hidDEN></table>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <input>\n|       type=\" hidden\"\n|     <table>\n|       <input>\n|         type=\"hidDEN\"\n"
+       }, {
+               name: "tests7.dat #21"
+               html: "<!doctype html><table><select>X<tr>"
+               errors: 3
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       \"X\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests7.dat #22"
+               html: "<!doctype html><select>X</select>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       \"X\"\n"
+       }, {
+               name: "tests7.dat #23"
+               html: "<!DOCTYPE hTmL><html></html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests7.dat #24"
+               html: "<!DOCTYPE HTML><html></html>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "tests7.dat #25"
+               html: "<body>X</body></body>"
+               errors: 1,"document-fragment":"html"
+               expected: "| <head>\n| <body>\n|   \"X\"\n"
+       }, {
+               name: "tests7.dat #26"
+               html: "<div><p>a</x> b"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <p>\n|         \"a b\"\n"
+       }, {
+               name: "tests7.dat #27"
+               html: "<table><tr><td><code></code> </table>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <code>\n|             \" \"\n"
+       }, {
+               name: "tests7.dat #28"
+               html: "<table><b><tr><td>aaa</td></tr>bbb</table>ccc"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|     <b>\n|       \"bbb\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"aaa\"\n|     <b>\n|       \"ccc\"\n"
+       }, {
+               name: "tests7.dat #29"
+               html: "A<table><tr> B</tr> B</table>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"A B B\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests7.dat #30"
+               html: "A<table><tr> B</tr> </em>C</table>"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"A BC\"\n|     <table>\n|       <tbody>\n|         <tr>\n|         \" \"\n"
+       }, {
+               name: "tests7.dat #31"
+               html: "<select><keygen>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <keygen>\n"
+       }, {
+               name: "tests8.dat #1"
+               html: "<div>\n<div></div>\n</span>x"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"\n\"\n|       <div>\n|       \"\nx\"\n"
+       }, {
+               name: "tests8.dat #2"
+               html: "<div>x<div></div>\n</span>x"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"x\"\n|       <div>\n|       \"\nx\"\n"
+       }, {
+               name: "tests8.dat #3"
+               html: "<div>x<div></div>x</span>x"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"x\"\n|       <div>\n|       \"xx\"\n"
+       }, {
+               name: "tests8.dat #4"
+               html: "<div>x<div></div>y</span>z"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"x\"\n|       <div>\n|       \"yz\"\n"
+       }, {
+               name: "tests8.dat #5"
+               html: "<table><div>x<div></div>x</span>x"
+               errors: 10
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"x\"\n|       <div>\n|       \"xx\"\n|     <table>\n"
+       }, {
+               name: "tests8.dat #6"
+               html: "x<table>x"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"xx\"\n|     <table>\n"
+       }, {
+               name: "tests8.dat #7"
+               html: "x<table><table>x"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"x\"\n|     <table>\n|     \"x\"\n|     <table>\n"
+       }, {
+               name: "tests8.dat #8"
+               html: "<b>a<div></div><div></b>y"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"a\"\n|       <div>\n|     <div>\n|       <b>\n|       \"y\"\n"
+       }, {
+               name: "tests8.dat #9"
+               html: "<a><div><p></a>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <div>\n|       <a>\n|       <p>\n|         <a>\n"
+       }, {
+               name: "tests9.dat #1"
+               html: "<!DOCTYPE html><math></math>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n"
+       }, {
+               name: "tests9.dat #2"
+               html: "<!DOCTYPE html><body><math></math>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n"
+       }, {
+               name: "tests9.dat #3"
+               html: "<!DOCTYPE html><math><mi>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n"
+       }, {
+               name: "tests9.dat #4"
+               html: "<!DOCTYPE html><math><annotation-xml><svg><u>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         <svg svg>\n|     <u>\n"
+       }, {
+               name: "tests9.dat #5"
+               html: "<!DOCTYPE html><body><select><math></math></select>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
+       }, {
+               name: "tests9.dat #6"
+               html: "<!DOCTYPE html><body><select><option><math></math></option></select>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n"
+       }, {
+               name: "tests9.dat #7"
+               html: "<!DOCTYPE html><body><table><math></math></table>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|     <table>\n"
+       }, {
+               name: "tests9.dat #8"
+               html: "<!DOCTYPE html><body><table><math><mi>foo</mi></math></table>"
+               errors: 4
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|     <table>\n"
+       }, {
+               name: "tests9.dat #9"
+               html: "<!DOCTYPE html><body><table><math><mi>foo</mi><mi>bar</mi></math></table>"
+               errors: 7
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <table>\n"
+       }, {
+               name: "tests9.dat #10"
+               html: "<!DOCTYPE html><body><table><tbody><math><mi>foo</mi><mi>bar</mi></math></tbody></table>"
+               errors: 7
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <table>\n|       <tbody>\n"
+       }, {
+               name: "tests9.dat #11"
+               html: "<!DOCTYPE html><body><table><tbody><tr><math><mi>foo</mi><mi>bar</mi></math></tr></tbody></table>"
+               errors: 7
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests9.dat #12"
+               html: "<!DOCTYPE html><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math></td></tr></tbody></table>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <math math>\n|               <math mi>\n|                 \"foo\"\n|               <math mi>\n|                 \"bar\"\n"
+       }, {
+               name: "tests9.dat #13"
+               html: "<!DOCTYPE html><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math><p>baz</td></tr></tbody></table>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <math math>\n|               <math mi>\n|                 \"foo\"\n|               <math mi>\n|                 \"bar\"\n|             <p>\n|               \"baz\"\n"
+       }, {
+               name: "tests9.dat #14"
+               html: "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi></math><p>baz</caption></table>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <math math>\n|           <math mi>\n|             \"foo\"\n|           <math mi>\n|             \"bar\"\n|         <p>\n|           \"baz\"\n"
+       }, {
+               name: "tests9.dat #15"
+               html: "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <math math>\n|           <math mi>\n|             \"foo\"\n|           <math mi>\n|             \"bar\"\n|         <p>\n|           \"baz\"\n|     <p>\n|       \"quux\"\n"
+       }, {
+               name: "tests9.dat #16"
+               html: "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi>baz</table><p>quux"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <math math>\n|           <math mi>\n|             \"foo\"\n|           <math mi>\n|             \"bar\"\n|           \"baz\"\n|     <p>\n|       \"quux\"\n"
+       }, {
+               name: "tests9.dat #17"
+               html: "<!DOCTYPE html><body><table><colgroup><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux"
+               errors: 12
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n|     <table>\n|       <colgroup>\n|     <p>\n|       \"quux\"\n"
+       }, {
+               name: "tests9.dat #18"
+               html: "<!DOCTYPE html><body><table><tr><td><select><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux"
+               errors: 7
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <select>\n|               \"foobarbaz\"\n|     <p>\n|       \"quux\"\n"
+       }, {
+               name: "tests9.dat #19"
+               html: "<!DOCTYPE html><body><table><select><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux"
+               errors: 8
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       \"foobarbaz\"\n|     <table>\n|     <p>\n|       \"quux\"\n"
+       }, {
+               name: "tests9.dat #20"
+               html: "<!DOCTYPE html><body></body></html><math><mi>foo</mi><mi>bar</mi><p>baz"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n"
+       }, {
+               name: "tests9.dat #21"
+               html: "<!DOCTYPE html><body></body><math><mi>foo</mi><mi>bar</mi><p>baz"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n"
+       }, {
+               name: "tests9.dat #22"
+               html: "<!DOCTYPE html><frameset><math><mi></mi><mi></mi><p><span>"
+               errors: 8
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests9.dat #23"
+               html: "<!DOCTYPE html><frameset></frameset><math><mi></mi><mi></mi><p><span>"
+               errors: 7
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "tests9.dat #24"
+               html: "<!DOCTYPE html><body xlink:href=foo><math xlink:href=foo></math>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     <math math>\n|       xlink href=\"foo\"\n"
+       }, {
+               name: "tests9.dat #25"
+               html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo></mi></math>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <math math>\n|       <math mi>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n"
+       }, {
+               name: "tests9.dat #26"
+               html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo /></math>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <math math>\n|       <math mi>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n"
+       }, {
+               name: "tests9.dat #27"
+               html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo />bar</math>"
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <math math>\n|       <math mi>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n|       \"bar\"\n"
+       }, {
+               name: "tests_innerHTML_1.dat #1"
+               html: "<body><span>"
+               errors: 2,"document-fragment":"body"
+               expected: "| <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #2"
+               html: "<span><body>"
+               errors: 2,"document-fragment":"body"
+               expected: "| <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #3"
+               html: "<span><body>"
+               errors: 2,"document-fragment":"div"
+               expected: "| <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #4"
+               html: "<body><span>"
+               errors: 1,"document-fragment":"html"
+               expected: "| <head>\n| <body>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #5"
+               html: "<frameset><span>"
+               errors: 2,"document-fragment":"body"
+               expected: "| <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #6"
+               html: "<span><frameset>"
+               errors: 2,"document-fragment":"body"
+               expected: "| <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #7"
+               html: "<span><frameset>"
+               errors: 2,"document-fragment":"div"
+               expected: "| <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #8"
+               html: "<frameset><span>"
+               errors: 2,"document-fragment":"html"
+               expected: "| <head>\n| <frameset>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #9"
+               html: "<table><tr>"
+               errors: 1,"document-fragment":"table"
+               expected: "| <tbody>\n|   <tr>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #10"
+               html: "</table><tr>"
+               errors: 1,"document-fragment":"table"
+               expected: "| <tbody>\n|   <tr>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #11"
+               html: "<a>"
+               errors: 2,"document-fragment":"table"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #12"
+               html: "<a>"
+               errors: 2,"document-fragment":"table"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #13"
+               html: "<a><caption>a"
+               errors: 2,"document-fragment":"table"
+               expected: "| <a>\n| <caption>\n|   \"a\"\n"
+       }, {
+               name: "tests_innerHTML_1.dat #14"
+               html: "<a><colgroup><col>"
+               errors: 2,"document-fragment":"table"
+               expected: "| <a>\n| <colgroup>\n|   <col>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #15"
+               html: "<a><tbody><tr>"
+               errors: 1,"document-fragment":"table"
+               expected: "| <a>\n| <tbody>\n|   <tr>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #16"
+               html: "<a><tfoot><tr>"
+               errors: 1,"document-fragment":"table"
+               expected: "| <a>\n| <tfoot>\n|   <tr>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #17"
+               html: "<a><thead><tr>"
+               errors: 1,"document-fragment":"table"
+               expected: "| <a>\n| <thead>\n|   <tr>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #18"
+               html: "<a><tr>"
+               errors: 1,"document-fragment":"table"
+               expected: "| <a>\n| <tbody>\n|   <tr>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #19"
+               html: "<a><th>"
+               errors: 2,"document-fragment":"table"
+               expected: "| <a>\n| <tbody>\n|   <tr>\n|     <th>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #20"
+               html: "<a><td>"
+               errors: 2,"document-fragment":"table"
+               expected: "| <a>\n| <tbody>\n|   <tr>\n|     <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #21"
+               html: "<table></table><tbody>"
+               errors: 1,"document-fragment":"caption"
+               expected: "| <table>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #22"
+               html: "</table><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #23"
+               html: "<span></table>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #24"
+               html: "</caption><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #25"
+               html: "<span></caption><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #26"
+               html: "<span><caption><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #27"
+               html: "<span><col><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #28"
+               html: "<span><colgroup><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #29"
+               html: "<span><html><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #30"
+               html: "<span><tbody><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #31"
+               html: "<span><td><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #32"
+               html: "<span><tfoot><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #33"
+               html: "<span><thead><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #34"
+               html: "<span><th><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #35"
+               html: "<span><tr><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #36"
+               html: "<span></table><span>"
+               errors: 2,"document-fragment":"caption"
+               expected: "| <span>\n|   <span>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #37"
+               html: "</colgroup><col>"
+               errors: 1,"document-fragment":"colgroup"
+               expected: "| <col>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #38"
+               html: "<a><col>"
+               errors: 1,"document-fragment":"colgroup"
+               expected: "| <col>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #39"
+               html: "<caption><a>"
+               errors: 3,"document-fragment":"tbody"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #40"
+               html: "<col><a>"
+               errors: 3,"document-fragment":"tbody"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #41"
+               html: "<colgroup><a>"
+               errors: 3,"document-fragment":"tbody"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #42"
+               html: "<tbody><a>"
+               errors: 3,"document-fragment":"tbody"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #43"
+               html: "<tfoot><a>"
+               errors: 3,"document-fragment":"tbody"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #44"
+               html: "<thead><a>"
+               errors: 3,"document-fragment":"tbody"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #45"
+               html: "</table><a>"
+               errors: 3,"document-fragment":"tbody"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #46"
+               html: "<a><tr>"
+               errors: 1,"document-fragment":"tbody"
+               expected: "| <a>\n| <tr>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #47"
+               html: "<a><td>"
+               errors: 2,"document-fragment":"tbody"
+               expected: "| <a>\n| <tr>\n|   <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #48"
+               html: "<a><td>"
+               errors: 2,"document-fragment":"tbody"
+               expected: "| <a>\n| <tr>\n|   <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #49"
+               html: "<a><td>"
+               errors: 2,"document-fragment":"tbody"
+               expected: "| <a>\n| <tr>\n|   <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #50"
+               html: "<td><table><tbody><a><tr>"
+               errors: 3,"document-fragment":"tbody"
+               expected: "| <tr>\n|   <td>\n|     <a>\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #51"
+               html: "</tr><td>"
+               errors: 1,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #52"
+               html: "<td><table><a><tr></tr><tr>"
+               errors: 2,"document-fragment":"tr"
+               expected: "| <td>\n|   <a>\n|   <table>\n|     <tbody>\n|       <tr>\n|       <tr>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #53"
+               html: "<caption><td>"
+               errors: 1,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #54"
+               html: "<col><td>"
+               errors: 1,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #55"
+               html: "<colgroup><td>"
+               errors: 1,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #56"
+               html: "<tbody><td>"
+               errors: 1,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #57"
+               html: "<tfoot><td>"
+               errors: 1,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #58"
+               html: "<thead><td>"
+               errors: 1,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #59"
+               html: "<tr><td>"
+               errors: 1,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #60"
+               html: "</table><td>"
+               errors: 1,"document-fragment":"tr"
+               expected: "| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #61"
+               html: "<td><table></table><td>"
+               fragment: "tr"
+               expected: "| <td>\n|   <table>\n| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #62"
+               html: "<td><table></table><td>"
+               fragment: "tr"
+               expected: "| <td>\n|   <table>\n| <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #63"
+               html: "<caption><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #64"
+               html: "<col><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #65"
+               html: "<colgroup><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #66"
+               html: "<tbody><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #67"
+               html: "<tfoot><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #68"
+               html: "<th><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #69"
+               html: "<thead><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #70"
+               html: "<tr><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #71"
+               html: "</table><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #72"
+               html: "</tbody><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #73"
+               html: "</td><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #74"
+               html: "</tfoot><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #75"
+               html: "</thead><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #76"
+               html: "</th><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #77"
+               html: "</tr><a>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <a>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #78"
+               html: "<table><td><td>"
+               errors: 2,"document-fragment":"td"
+               expected: "| <table>\n|   <tbody>\n|     <tr>\n|       <td>\n|       <td>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #79"
+               html: "</select><option>"
+               errors: 2,"document-fragment":"select"
+               expected: "| <option>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #80"
+               html: "<input><option>"
+               errors: 2,"document-fragment":"select"
+               expected: "| <option>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #81"
+               html: "<keygen><option>"
+               errors: 2,"document-fragment":"select"
+               expected: "| <option>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #82"
+               html: "<textarea><option>"
+               errors: 2,"document-fragment":"select"
+               expected: "| <option>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #83"
+               html: "</html><!--abc-->"
+               errors: 1,"document-fragment":"html"
+               expected: "| <head>\n| <body>\n| <!-- abc -->\n"
+       }, {
+               name: "tests_innerHTML_1.dat #84"
+               html: "</frameset><frame>"
+               errors: 1,"document-fragment":"frameset"
+               expected: "| <frame>\n"
+       }, {
+               name: "tests_innerHTML_1.dat #85"
+               fragment: "html"
+               expected: "| <head>\n| <body>\n"
+       }, {
+               name: "tricky01.dat #1"
+               html: "<b><p>Bold </b> Not bold</p>\nAlso not bold."
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|     <p>\n|       <b>\n|         \"Bold \"\n|       \" Not bold\"\n|     \"\nAlso not bold.\"\n"
+       }, {
+               name: "tricky01.dat #2"
+               html: "<html>\n<font color=red><i>Italic and Red<p>Italic and Red </font> Just italic.</p> Italic only.</i> Plain\n<p>I should not be red. <font color=red>Red. <i>Italic and red.</p>\n<p>Italic and red. </i> Red.</font> I should not be red.</p>\n<b>Bold <i>Bold and italic</b> Only Italic </i> Plain"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <font>\n|       color=\"red\"\n|       <i>\n|         \"Italic and Red\"\n|     <i>\n|       <p>\n|         <font>\n|           color=\"red\"\n|           \"Italic and Red \"\n|         \" Just italic.\"\n|       \" Italic only.\"\n|     \" Plain\n\"\n|     <p>\n|       \"I should not be red. \"\n|       <font>\n|         color=\"red\"\n|         \"Red. \"\n|         <i>\n|           \"Italic and red.\"\n|     <font>\n|       color=\"red\"\n|       <i>\n|         \"\n\"\n|     <p>\n|       <font>\n|         color=\"red\"\n|         <i>\n|           \"Italic and red. \"\n|         \" Red.\"\n|       \" I should not be red.\"\n|     \"\n\"\n|     <b>\n|       \"Bold \"\n|       <i>\n|         \"Bold and italic\"\n|     <i>\n|       \" Only Italic \"\n|     \" Plain\"\n"
+       }, {
+               name: "tricky01.dat #3"
+               html: "<html><body>\n<p><font size=\"7\">First paragraph.</p>\n<p>Second paragraph.</p></font>\n<b><p><i>Bold and Italic</b> Italic</p>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"\n\"\n|     <p>\n|       <font>\n|         size=\"7\"\n|         \"First paragraph.\"\n|     <font>\n|       size=\"7\"\n|       \"\n\"\n|       <p>\n|         \"Second paragraph.\"\n|     \"\n\"\n|     <b>\n|     <p>\n|       <b>\n|         <i>\n|           \"Bold and Italic\"\n|       <i>\n|         \" Italic\"\n"
+       }, {
+               name: "tricky01.dat #4"
+               html: "<html>\n<dl>\n<dt><b>Boo\n<dd>Goo?\n</dl>\n</html>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <dl>\n|       \"\n\"\n|       <dt>\n|         <b>\n|           \"Boo\n\"\n|       <dd>\n|         <b>\n|           \"Goo?\n\"\n|     <b>\n|       \"\n\"\n"
+       }, {
+               name: "tricky01.dat #5"
+               html: "<html><body>\n<label><a><div>Hello<div>World</div></a></label>  \n</body></html>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"\n\"\n|     <label>\n|       <a>\n|       <div>\n|         <a>\n|           \"Hello\"\n|           <div>\n|             \"World\"\n|         \"  \n\"\n"
+       }, {
+               name: "tricky01.dat #6"
+               html: "<table><center> <font>a</center> <img> <tr><td> </td> </tr> </table>"
+               errors: 9
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <center>\n|       \" \"\n|       <font>\n|         \"a\"\n|     <font>\n|       <img>\n|       \" \"\n|     <table>\n|       \" \"\n|       <tbody>\n|         <tr>\n|           <td>\n|             \" \"\n|           \" \"\n|         \" \"\n"
+       }, {
+               name: "tricky01.dat #7"
+               html: "<table><tr><p><a><p>You should see this text."
+               errors: 31
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <a>\n|     <p>\n|       <a>\n|         \"You should see this text.\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
+       }, {
+               name: "tricky01.dat #8"
+               html: "<TABLE>\n<TR>\n<CENTER><CENTER><TD></TD></TR><TR>\n<FONT>\n<TABLE><tr></tr></TABLE>\n</P>\n<a></font><font></a>\nThis page contains an insanely badly-nested tag sequence."
+               errors: 10
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <center>\n|       <center>\n|     <font>\n|       \"\n\"\n|     <table>\n|       \"\n\"\n|       <tbody>\n|         <tr>\n|           \"\n\"\n|           <td>\n|         <tr>\n|           \"\n\"\n|     <table>\n|       <tbody>\n|         <tr>\n|     <font>\n|       \"\n\"\n|       <p>\n|       \"\n\"\n|       <a>\n|     <a>\n|       <font>\n|     <font>\n|       \"\nThis page contains an insanely badly-nested tag sequence.\"\n"
+       }, {
+               name: "tricky01.dat #9"
+               html: "<html>\n<body>\n<b><nobr><div>This text is in a div inside a nobr</nobr>More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. </b><pre>A pre tag outside everything else.</pre>\n</body>\n</html>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"\n\"\n|     <b>\n|       <nobr>\n|     <div>\n|       <b>\n|         <nobr>\n|           \"This text is in a div inside a nobr\"\n|         \"More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. \"\n|       <pre>\n|         \"A pre tag outside everything else.\"\n|       \"\n\n\"\n"
+       }, {
+               name: "webkit01.dat #1"
+               html: "Test"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"Test\"\n"
+       }, {
+               name: "webkit01.dat #2"
+               html: "<div></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n"
+       }, {
+               name: "webkit01.dat #3"
+               html: "<div>Test</div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"Test\"\n"
+       }, {
+               name: "webkit01.dat #4"
+               html: "<di"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "webkit01.dat #5"
+               html: "<div>Hello</div>\n<script>\nconsole.log(\"PASS\");\n</script>\n<div>Bye</div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"Hello\"\n|     \"\n\"\n|     <script>\n|       \"\nconsole.log(\"PASS\");\n\"\n|     \"\n\"\n|     <div>\n|       \"Bye\"\n"
+       }, {
+               name: "webkit01.dat #6"
+               html: "<div foo=\"bar\">Hello</div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       foo=\"bar\"\n|       \"Hello\"\n"
+       }, {
+               name: "webkit01.dat #7"
+               html: "<div>Hello</div>\n<script>\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n</script>\n<div>Bye</div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"Hello\"\n|     \"\n\"\n|     <script>\n|       \"\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n\"\n|     \"\n\"\n|     <div>\n|       \"Bye\"\n"
+       }, {
+               name: "webkit01.dat #8"
+               html: "<foo bar=\"baz\"></foo><potato quack=\"duck\"></potato>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       bar=\"baz\"\n|     <potato>\n|       quack=\"duck\"\n"
+       }, {
+               name: "webkit01.dat #9"
+               html: "<foo bar=\"baz\"><potato quack=\"duck\"></potato></foo>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       bar=\"baz\"\n|       <potato>\n|         quack=\"duck\"\n"
+       }, {
+               name: "webkit01.dat #10"
+               html: "<foo></foo bar=\"baz\"><potato></potato quack=\"duck\">"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|     <potato>\n"
+       }, {
+               name: "webkit01.dat #11"
+               html: "</ tttt>"
+               errors: 2
+               expected: "| <!--  tttt -->\n| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "webkit01.dat #12"
+               html: "<div FOO ><img><img></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       foo=\"\"\n|       <img>\n|       <img>\n"
+       }, {
+               name: "webkit01.dat #13"
+               html: "<p>Test</p<p>Test2</p>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"TestTest2\"\n"
+       }, {
+               name: "webkit01.dat #14"
+               html: "<rdar://problem/6869687>"
+               errors: 5
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <rdar:>\n|       6869687=\"\"\n|       problem=\"\"\n"
+       }, {
+               name: "webkit01.dat #15"
+               html: "<A>test< /A>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"test< /A>\"\n"
+       }, {
+               name: "webkit01.dat #16"
+               html: "&lt;"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"<\"\n"
+       }, {
+               name: "webkit01.dat #17"
+               html: "<body foo='bar'><body foo='baz' yo='mama'>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     foo=\"bar\"\n|     yo=\"mama\"\n"
+       }, {
+               name: "webkit01.dat #18"
+               html: "<body></br foo=\"bar\"></body>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <br>\n"
+       }, {
+               name: "webkit01.dat #19"
+               html: "<bdy><br foo=\"bar\"></body>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <bdy>\n|       <br>\n|         foo=\"bar\"\n"
+       }, {
+               name: "webkit01.dat #20"
+               html: "<body></body></br foo=\"bar\">"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <br>\n"
+       }, {
+               name: "webkit01.dat #21"
+               html: "<bdy></body><br foo=\"bar\">"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <bdy>\n|       <br>\n|         foo=\"bar\"\n"
+       }, {
+               name: "webkit01.dat #22"
+               html: "<html><body></body></html><!-- Hi there -->"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n| <!--  Hi there  -->\n"
+       }, {
+               name: "webkit01.dat #23"
+               html: "<html><body></body></html>x<!-- Hi there -->"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"x\"\n|     <!--  Hi there  -->\n"
+       }, {
+               name: "webkit01.dat #24"
+               html: "<html><body></body></html>x<!-- Hi there --></html><!-- Again -->"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"x\"\n|     <!--  Hi there  -->\n| <!--  Again  -->\n"
+       }, {
+               name: "webkit01.dat #25"
+               html: "<html><body></body></html>x<!-- Hi there --></body></html><!-- Again -->"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"x\"\n|     <!--  Hi there  -->\n| <!--  Again  -->\n"
+       }, {
+               name: "webkit01.dat #26"
+               html: "<html><body><ruby><div><rp>xx</rp></div></ruby></body></html>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <rp>\n|           \"xx\"\n"
+       }, {
+               name: "webkit01.dat #27"
+               html: "<html><body><ruby><div><rt>xx</rt></div></ruby></body></html>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <rt>\n|           \"xx\"\n"
+       }, {
+               name: "webkit01.dat #28"
+               html: "<html><frameset><!--1--><noframes>A</noframes><!--2--></frameset><!--3--><noframes>B</noframes><!--4--></html><!--5--><noframes>C</noframes><!--6-->"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <frameset>\n|     <!-- 1 -->\n|     <noframes>\n|       \"A\"\n|     <!-- 2 -->\n|   <!-- 3 -->\n|   <noframes>\n|     \"B\"\n|   <!-- 4 -->\n|   <noframes>\n|     \"C\"\n| <!-- 5 -->\n| <!-- 6 -->\n"
+       }, {
+               name: "webkit01.dat #29"
+               html: "<select><option>A<select><option>B<select><option>C<select><option>D<select><option>E<select><option>F<select><option>G<select>"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|         \"A\"\n|     <option>\n|       \"B\"\n|       <select>\n|         <option>\n|           \"C\"\n|     <option>\n|       \"D\"\n|       <select>\n|         <option>\n|           \"E\"\n|     <option>\n|       \"F\"\n|       <select>\n|         <option>\n|           \"G\"\n"
+       }, {
+               name: "webkit01.dat #30"
+               html: "<dd><dd><dt><dt><dd><li><li>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <dd>\n|     <dd>\n|     <dt>\n|     <dt>\n|     <dd>\n|       <li>\n|       <li>\n"
+       }, {
+               name: "webkit01.dat #31"
+               html: "<div><b></div><div><nobr>a<nobr>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <b>\n|     <div>\n|       <b>\n|         <nobr>\n|           \"a\"\n|         <nobr>\n"
+       }, {
+               name: "webkit01.dat #32"
+               html: "<head></head>\n<body></body>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   \"\n\"\n|   <body>\n"
+       }, {
+               name: "webkit01.dat #33"
+               html: "<head></head> <style></style>ddd"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|     <style>\n|   \" \"\n|   <body>\n|     \"ddd\"\n"
+       }, {
+               name: "webkit01.dat #34"
+               html: "<kbd><table></kbd><col><select><tr>"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <kbd>\n|       <select>\n|       <table>\n|         <colgroup>\n|           <col>\n|         <tbody>\n|           <tr>\n"
+       }, {
+               name: "webkit01.dat #35"
+               html: "<kbd><table></kbd><col><select><tr></table><div>"
+               errors: 6
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <kbd>\n|       <select>\n|       <table>\n|         <colgroup>\n|           <col>\n|         <tbody>\n|           <tr>\n|       <div>\n"
+       }, {
+               name: "webkit01.dat #36"
+               html: "<a><li><style></style><title></title></a>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <li>\n|       <a>\n|         <style>\n|         <title>\n"
+       }, {
+               name: "webkit01.dat #37"
+               html: "<font></p><p><meta><title></title></font>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <font>\n|       <p>\n|     <p>\n|       <font>\n|         <meta>\n|         <title>\n"
+       }, {
+               name: "webkit01.dat #38"
+               html: "<a><center><title></title><a>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <center>\n|       <a>\n|         <title>\n|       <a>\n"
+       }, {
+               name: "webkit01.dat #39"
+               html: "<svg><title><div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg title>\n|         <div>\n"
+       }, {
+               name: "webkit01.dat #40"
+               html: "<svg><title><rect><div>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg title>\n|         <rect>\n|           <div>\n"
+       }, {
+               name: "webkit01.dat #41"
+               html: "<svg><title><svg><div>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg title>\n|         <svg svg>\n|         <div>\n"
+       }, {
+               name: "webkit01.dat #42"
+               html: "<img <=\"\" FAIL>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <img>\n|       <=\"\"\n|       fail=\"\"\n"
+       }, {
+               name: "webkit01.dat #43"
+               html: "<ul><li><div id='foo'/>A</li><li>B<div>C</div></li></ul>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <ul>\n|       <li>\n|         <div>\n|           id=\"foo\"\n|           \"A\"\n|       <li>\n|         \"B\"\n|         <div>\n|           \"C\"\n"
+       }, {
+               name: "webkit01.dat #44"
+               html: "<svg><em><desc></em>"
+               errors: 3
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <em>\n|       <desc>\n"
+       }, {
+               name: "webkit01.dat #45"
+               html: "<table><tr><td><svg><desc><td></desc><circle>"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg desc>\n|           <td>\n|             <circle>\n"
+       }, {
+               name: "webkit01.dat #46"
+               html: "<svg><tfoot></mi><td>"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg tfoot>\n|         <svg td>\n"
+       }, {
+               name: "webkit01.dat #47"
+               html: "<math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mrow>\n|         <math mrow>\n|           <math mn>\n|             \"1\"\n|         <math mi>\n|           \"a\"\n"
+       }, {
+               name: "webkit01.dat #48"
+               html: "<!doctype html><input type=\"hidden\"><frameset>"
+               errors: 2
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
+       }, {
+               name: "webkit01.dat #49"
+               html: "<!doctype html><input type=\"button\"><frameset>"
+               errors: 1
+               expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <input>\n|       type=\"button\"\n"
+       }, {
+               name: "webkit02.dat #1"
+               html: "<foo bar=qux/>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       bar=\"qux/\"\n"
+       }, {
+               name: "webkit02.dat #2"
+               html: "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       id=\"status\"\n|       <noscript>\n|         \"<strong>A</strong>\"\n|       <span>\n|         \"B\"\n"
+       }, {
+               name: "webkit02.dat #3"
+               html: "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       id=\"status\"\n|       <noscript>\n|         <strong>\n|           \"A\"\n|       <span>\n|         \"B\"\n"
+       }, {
+               name: "webkit02.dat #4"
+               html: "<div><sarcasm><div></div></sarcasm></div>"
+               errors: 1
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <sarcasm>\n|         <div>\n"
+       }, {
+               name: "webkit02.dat #5"
+               html: "<html><body><img src=\"\" border=\"0\" alt=\"><div>A</div></body></html>"
+               errors: 2
+               expected: "| <html>\n|   <head>\n|   <body>\n"
+       }, {
+               name: "webkit02.dat #6"
+               html: "<table><td></tbody>A"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     \"A\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
+       }, {
+               name: "webkit02.dat #7"
+               html: "<table><td></thead>A"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"A\"\n"
+       }, {
+               name: "webkit02.dat #8"
+               html: "<table><td></tfoot>A"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"A\"\n"
+       }, {
+               name: "webkit02.dat #9"
+               html: "<table><thead><td></tbody>A"
+               errors: 4
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <thead>\n|         <tr>\n|           <td>\n|             \"A\"\n"
+       }, {
+               name: "webkit02.dat #10"
+               html: "<legend>test</legend>"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <legend>\n|       \"test\"\n"
+       }, {
+               name: "webkit02.dat #11"
+               html: "<table><input>"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <input>\n|     <table>\n"
+       }, {
+               name: "webkit02.dat #12"
+               html: "<b><em><foo><foo><aside></b>"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <em>\n|         <foo>\n|           <foo>\n|     <em>\n|       <aside>\n|         <b>\n"
+       }, {
+               name: "webkit02.dat #13"
+               html: "<b><em><foo><foo><aside></b></em>"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <em>\n|         <foo>\n|           <foo>\n|     <em>\n|     <aside>\n|       <em>\n|         <b>\n"
+       }, {
+               name: "webkit02.dat #14"
+               html: "<b><em><foo><foo><foo><aside></b>"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <em>\n|         <foo>\n|           <foo>\n|             <foo>\n|     <aside>\n|       <b>\n"
+       }, {
+               name: "webkit02.dat #15"
+               html: "<b><em><foo><foo><foo><aside></b></em>"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <em>\n|         <foo>\n|           <foo>\n|             <foo>\n|     <aside>\n|       <b>\n"
+       }, {
+               name: "webkit02.dat #16"
+               html: "<b><em><foo><foo><foo><foo><foo><foo><foo><foo><foo><foo><aside></b></em>"
+               fragment: "div"
+               expected: "| <b>\n|   <em>\n|     <foo>\n|       <foo>\n|         <foo>\n|           <foo>\n|             <foo>\n|               <foo>\n|                 <foo>\n|                   <foo>\n|                     <foo>\n|                       <foo>\n| <aside>\n|   <b>\n"
+       }, {
+               name: "webkit02.dat #17"
+               html: "<b><em><foo><foob><foob><foob><foob><fooc><fooc><fooc><fooc><food><aside></b></em>"
+               fragment: "div"
+               expected: "| <b>\n|   <em>\n|     <foo>\n|       <foob>\n|         <foob>\n|           <foob>\n|             <foob>\n|               <fooc>\n|                 <fooc>\n|                   <fooc>\n|                     <fooc>\n|                       <food>\n| <aside>\n|   <b>\n"
+       }, {
+               name: "webkit02.dat #18"
+               html: "<isindex action=\"x\">"
+               fragment: "table"
+               expected: "| <form>\n|   action=\"x\"\n|   <hr>\n|   <label>\n|     \"This is a searchable index. Enter search keywords: \"\n|     <input>\n|       name=\"isindex\"\n|   <hr>\n"
+       }, {
+               name: "webkit02.dat #19"
+               html: "<option><XH<optgroup></optgroup>"
+               fragment: "select"
+               expected: "| <option>\n"
+       }, {
+               name: "webkit02.dat #20"
+               html: "<svg><foreignObject><div>foo</div><plaintext></foreignObject></svg><div>bar</div>"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|         <div>\n|           \"foo\"\n|         <plaintext>\n|           \"</foreignObject></svg><div>bar</div>\"\n"
+       }, {
+               name: "webkit02.dat #21"
+               html: "<svg><foreignObject></foreignObject><title></svg>foo"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|       <svg title>\n|     \"foo\"\n"
+       }, {
+               name: "webkit02.dat #22"
+               html: "</foreignObject><plaintext><div>foo</div>"
+               expected: "| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"<div>foo</div>\"\n"
+       }
+]
+
+if window?.wheic?
+       wheic = window.wheic
+else
+       wheic = require './wheic.js'
+
+serialize_els = (els, prefix = '| ') ->
+       ret = ''
+       for el in els
+               switch el.type
+                       when wheic.TYPE_TAG
+                               ret += "#{prefix}<#{el.name}>\n"
+                               attr_keys = []
+                               for k of el.attrs
+                                       attr_keys.push k
+                               attr_keys.sort() # TODO this should be "lexicographically by UTF-16 code unit"
+                               for k in attr_keys
+                                       ret += "#{prefix}  #{k}=\"#{el.attrs[k]}\"\n"
+                               # FIXME template shows as "content" with children below it
+                               ret += serialize_els el.children, "#{prefix}  "
+                       when wheic.TYPE_TEXT
+                               ret += "#{prefix}\"#{el.text}\"\n"
+                       when wheic.TYPE_COMMENT
+                               ret += "#{prefix}<!--#{el.text}-->\n"
+                       when wheic.TYPE_DOCTYPE
+                               ret += "#{prefix}<!DOCTYPE#{el.name}>\n" # FIXME add ids
+                       else
+                               ret += "#{prefix}UNKNOWN TAG TYPE #{el.type}"
+       return ret
+
+test_results = passed: 0, failed: 0
+test_parser = (args) ->
+       wheic.debug_log_reset()
+       parse_errors = []
+       errors_cb = (i) ->
+               parse_errors.push i
+       prev_node_id = 0 # reset counter
+       parsed = wheic.parse_html args.html, errors_cb
+       serialized = serialize_els parsed
+       if serialized isnt args.expected
+               #wheic.debug_log_each (str) ->
+               #       console.log str
+               console.log "FAILED: \"#{args.name}\""
+               console.log "      Input: #{args.html}"
+               console.log "    Correct: #{args.expected}"
+               console.log "     Output: #{serialized}"
+               if parse_errors.length > 0
+                       console.log " parse errs: #{JSON.stringify parse_errors}"
+               else
+                       console.log "   No parse errors"
+               test_results.failed += 1
+       else
+               console.log "passed \"#{args.name}\""
+               test_results.passed += 1
+test_summary = ->
+       console.log "Tests passed: #{test_results.passed}"
+       console.log "Tests Failed: #{test_results.failed}"
+
+
+next_test = 0
+run_tests_and_breathe = ->
+       start_time = new Date()
+       loop
+               if next_test >= tests.length
+                       return
+               test_parser tests[next_test]
+               next_test += 1
+               now = new Date()
+               if now - start_time > 100 # miliseconds
+                       setTimeout run_tests_and_breathe, 1
+run_tests_and_breathe()
+test_summary()