From 5be4d9791f4d11e80a608da2b6e122734628bf5c Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Sat, 19 Dec 2015 10:02:10 -0500 Subject: [PATCH] more tests from html5lib-tests --- parse-html.coffee | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/parse-html.coffee b/parse-html.coffee index 25fa20d..aaecff3 100644 --- a/parse-html.coffee +++ b/parse-html.coffee @@ -1943,9 +1943,31 @@ test_parser name: "html5lib aaa 5 (two divs deep)", \ test_parser name: "html5lib aaa 6 (foster parenting)", \ html: '1

23

', 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: '

', + expected: 'tag:"b",{},[tag:"b",{},[tag:"a",{},[],tag:"p",{},[tag:"a",{},[]]]]' +test_parser name: "html5lib aaa 8 (aaa, eof) 2", \ + html: '

', + expected: 'tag:"b",{},[tag:"a",{},[tag:"b",{},[]],tag:"b",{},[tag:"p",{},[tag:"a",{},[]]]]' +test_parser name: "html5lib aaa 9 (aaa, eof) 3", \ + html: '

', + 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: '

123

45', 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: '
13
2
', 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: 'AC
B
', + 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: '
', +# expected: 'tag:"a",{},[svg:"svg",{},[svg:"tr",{},[svg:"input"]]]' +test_parser name: "html5lib aaa 14 (deep ?outer aaa)", \ + html: '