+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"]',
+ errors: 2 # misplaced </span>, no </span> at the end
+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"',
+ errors: 1 # no idea how many their should be
+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"',
+ errors: 6 # no idea how many there should be
+# 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",{},[]]',
+ errors: 2
+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"]',
+ errors: 2
+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"]',
+ errors: 2
+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"]',
+ errors: 2
+test_parser name: "html5lib aaa 5", \
+ 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"]',
+ errors: 3