parse5 0.6.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +3 -1
- package/LICENSE +1 -1
- package/README.md +166 -77
- package/index.js +7 -0
- package/lib/{html.js → const/html.js} +0 -0
- package/lib/{unicode.js → const/unicode.js} +0 -0
- package/lib/{named_entity_trie.js → tokenization_stage/named_entity_trie.js} +1 -1
- package/lib/tokenization_stage/parser_simulator.js +2 -0
- package/lib/{preprocessor.js → tokenization_stage/preprocessor.js} +5 -5
- package/lib/{tokenizer.js → tokenization_stage/tokenizer.js} +37 -37
- package/lib/{default_tree_adapter.js → tree_adapters/default.js} +47 -0
- package/lib/tree_adapters/htmlparser2.js +267 -0
- package/lib/{formatting_element_list.js → tree_construction_stage/formatting_element_list.js} +1 -1
- package/lib/{open_element_stack.js → tree_construction_stage/open_element_stack.js} +2 -2
- package/lib/{parser.js → tree_construction_stage/parser.js} +8 -8
- package/lib/tree_construction_stage/tree_serializer.js +165 -0
- package/package.json +33 -26
- package/test/data/tokenizer/contentModelFlags.test +0 -75
- package/test/data/tokenizer/domjs.test +0 -90
- package/test/data/tokenizer/entities.test +0 -283
- package/test/data/tokenizer/escapeFlag.test +0 -33
- package/test/data/tokenizer/namedEntities.test +0 -44189
- package/test/data/tokenizer/numericEntities.test +0 -1313
- package/test/data/tokenizer/pendingSpecChanges.test +0 -7
- package/test/data/tokenizer/test1.test +0 -196
- package/test/data/tokenizer/test2.test +0 -179
- package/test/data/tokenizer/test3.test +0 -6047
- package/test/data/tokenizer/test4.test +0 -344
- package/test/data/tokenizer/unicodeChars.test +0 -1295
- package/test/data/tokenizer/unicodeCharsProblematic.test +0 -27
- package/test/data/tree-construction/adoption01.dat +0 -275
- package/test/data/tree-construction/adoption02.dat +0 -31
- package/test/data/tree-construction/comments01.dat +0 -146
- package/test/data/tree-construction/doctype01.dat +0 -370
- package/test/data/tree-construction/domjs-unsafe.dat +0 -0
- package/test/data/tree-construction/entities01.dat +0 -603
- package/test/data/tree-construction/entities02.dat +0 -249
- package/test/data/tree-construction/html5test-com.dat +0 -246
- package/test/data/tree-construction/inbody01.dat +0 -43
- package/test/data/tree-construction/isindex.dat +0 -40
- package/test/data/tree-construction/main-element.dat +0 -29
- package/test/data/tree-construction/pending-spec-changes-plain-text-unsafe.dat +0 -0
- package/test/data/tree-construction/pending-spec-changes.dat +0 -52
- package/test/data/tree-construction/plain-text-unsafe.dat +0 -0
- package/test/data/tree-construction/scriptdata01.dat +0 -308
- package/test/data/tree-construction/tables01.dat +0 -212
- package/test/data/tree-construction/tests1.dat +0 -1952
- package/test/data/tree-construction/tests10.dat +0 -799
- package/test/data/tree-construction/tests11.dat +0 -482
- package/test/data/tree-construction/tests12.dat +0 -62
- package/test/data/tree-construction/tests14.dat +0 -74
- package/test/data/tree-construction/tests15.dat +0 -208
- package/test/data/tree-construction/tests16.dat +0 -2299
- package/test/data/tree-construction/tests17.dat +0 -153
- package/test/data/tree-construction/tests18.dat +0 -269
- package/test/data/tree-construction/tests19.dat +0 -1249
- package/test/data/tree-construction/tests2.dat +0 -763
- package/test/data/tree-construction/tests20.dat +0 -455
- package/test/data/tree-construction/tests21.dat +0 -257
- package/test/data/tree-construction/tests22.dat +0 -157
- package/test/data/tree-construction/tests23.dat +0 -155
- package/test/data/tree-construction/tests24.dat +0 -79
- package/test/data/tree-construction/tests25.dat +0 -219
- package/test/data/tree-construction/tests26.dat +0 -313
- package/test/data/tree-construction/tests3.dat +0 -305
- package/test/data/tree-construction/tests4.dat +0 -59
- package/test/data/tree-construction/tests5.dat +0 -191
- package/test/data/tree-construction/tests6.dat +0 -663
- package/test/data/tree-construction/tests7.dat +0 -390
- package/test/data/tree-construction/tests8.dat +0 -148
- package/test/data/tree-construction/tests9.dat +0 -457
- package/test/data/tree-construction/tests_innerHTML_1.dat +0 -741
- package/test/data/tree-construction/tricky01.dat +0 -261
- package/test/data/tree-construction/webkit01.dat +0 -594
- package/test/data/tree-construction/webkit02.dat +0 -94
- package/test/fixtures/formatting_element_list_test.js +0 -267
- package/test/fixtures/open_element_stack_test.js +0 -495
- package/test/fixtures/parser_test.js +0 -160
- package/test/fixtures/tokenizer_test.js +0 -178
- package/test/run_tests.js +0 -10
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
#data
|
|
2
|
-
<!DOCTYPE html><p><b><i><u></p> <p>X
|
|
3
|
-
#errors
|
|
4
|
-
Line: 1 Col: 31 Unexpected end tag (p). Ignored.
|
|
5
|
-
Line: 1 Col: 36 Expected closing tag. Unexpected end of file.
|
|
6
|
-
#document
|
|
7
|
-
| <!DOCTYPE html>
|
|
8
|
-
| <html>
|
|
9
|
-
| <head>
|
|
10
|
-
| <body>
|
|
11
|
-
| <p>
|
|
12
|
-
| <b>
|
|
13
|
-
| <i>
|
|
14
|
-
| <u>
|
|
15
|
-
| <b>
|
|
16
|
-
| <i>
|
|
17
|
-
| <u>
|
|
18
|
-
| " "
|
|
19
|
-
| <p>
|
|
20
|
-
| "X"
|
|
21
|
-
|
|
22
|
-
#data
|
|
23
|
-
<p><b><i><u></p>
|
|
24
|
-
<p>X
|
|
25
|
-
#errors
|
|
26
|
-
Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE.
|
|
27
|
-
Line: 1 Col: 16 Unexpected end tag (p). Ignored.
|
|
28
|
-
Line: 2 Col: 4 Expected closing tag. Unexpected end of file.
|
|
29
|
-
#document
|
|
30
|
-
| <html>
|
|
31
|
-
| <head>
|
|
32
|
-
| <body>
|
|
33
|
-
| <p>
|
|
34
|
-
| <b>
|
|
35
|
-
| <i>
|
|
36
|
-
| <u>
|
|
37
|
-
| <b>
|
|
38
|
-
| <i>
|
|
39
|
-
| <u>
|
|
40
|
-
| "
|
|
41
|
-
"
|
|
42
|
-
| <p>
|
|
43
|
-
| "X"
|
|
44
|
-
|
|
45
|
-
#data
|
|
46
|
-
<!doctype html></html> <head>
|
|
47
|
-
#errors
|
|
48
|
-
Line: 1 Col: 22 Unexpected end tag (html) after the (implied) root element.
|
|
49
|
-
#document
|
|
50
|
-
| <!DOCTYPE html>
|
|
51
|
-
| <html>
|
|
52
|
-
| <head>
|
|
53
|
-
| <body>
|
|
54
|
-
| " "
|
|
55
|
-
|
|
56
|
-
#data
|
|
57
|
-
<!doctype html></body><meta>
|
|
58
|
-
#errors
|
|
59
|
-
Line: 1 Col: 22 Unexpected end tag (body) after the (implied) root element.
|
|
60
|
-
#document
|
|
61
|
-
| <!DOCTYPE html>
|
|
62
|
-
| <html>
|
|
63
|
-
| <head>
|
|
64
|
-
| <body>
|
|
65
|
-
| <meta>
|
|
66
|
-
|
|
67
|
-
#data
|
|
68
|
-
<html></html><!-- foo -->
|
|
69
|
-
#errors
|
|
70
|
-
Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
|
|
71
|
-
Line: 1 Col: 13 Unexpected end tag (html) after the (implied) root element.
|
|
72
|
-
#document
|
|
73
|
-
| <html>
|
|
74
|
-
| <head>
|
|
75
|
-
| <body>
|
|
76
|
-
| <!-- foo -->
|
|
77
|
-
|
|
78
|
-
#data
|
|
79
|
-
<!doctype html></body><title>X</title>
|
|
80
|
-
#errors
|
|
81
|
-
Line: 1 Col: 22 Unexpected end tag (body) after the (implied) root element.
|
|
82
|
-
#document
|
|
83
|
-
| <!DOCTYPE html>
|
|
84
|
-
| <html>
|
|
85
|
-
| <head>
|
|
86
|
-
| <body>
|
|
87
|
-
| <title>
|
|
88
|
-
| "X"
|
|
89
|
-
|
|
90
|
-
#data
|
|
91
|
-
<!doctype html><table> X<meta></table>
|
|
92
|
-
#errors
|
|
93
|
-
Line: 1 Col: 24 Unexpected non-space characters in table context caused voodoo mode.
|
|
94
|
-
Line: 1 Col: 30 Unexpected start tag (meta) in table context caused voodoo mode.
|
|
95
|
-
#document
|
|
96
|
-
| <!DOCTYPE html>
|
|
97
|
-
| <html>
|
|
98
|
-
| <head>
|
|
99
|
-
| <body>
|
|
100
|
-
| " X"
|
|
101
|
-
| <meta>
|
|
102
|
-
| <table>
|
|
103
|
-
|
|
104
|
-
#data
|
|
105
|
-
<!doctype html><table> x</table>
|
|
106
|
-
#errors
|
|
107
|
-
Line: 1 Col: 24 Unexpected non-space characters in table context caused voodoo mode.
|
|
108
|
-
#document
|
|
109
|
-
| <!DOCTYPE html>
|
|
110
|
-
| <html>
|
|
111
|
-
| <head>
|
|
112
|
-
| <body>
|
|
113
|
-
| " x"
|
|
114
|
-
| <table>
|
|
115
|
-
|
|
116
|
-
#data
|
|
117
|
-
<!doctype html><table> x </table>
|
|
118
|
-
#errors
|
|
119
|
-
Line: 1 Col: 25 Unexpected non-space characters in table context caused voodoo mode.
|
|
120
|
-
#document
|
|
121
|
-
| <!DOCTYPE html>
|
|
122
|
-
| <html>
|
|
123
|
-
| <head>
|
|
124
|
-
| <body>
|
|
125
|
-
| " x "
|
|
126
|
-
| <table>
|
|
127
|
-
|
|
128
|
-
#data
|
|
129
|
-
<!doctype html><table><tr> x</table>
|
|
130
|
-
#errors
|
|
131
|
-
Line: 1 Col: 28 Unexpected non-space characters in table context caused voodoo mode.
|
|
132
|
-
#document
|
|
133
|
-
| <!DOCTYPE html>
|
|
134
|
-
| <html>
|
|
135
|
-
| <head>
|
|
136
|
-
| <body>
|
|
137
|
-
| " x"
|
|
138
|
-
| <table>
|
|
139
|
-
| <tbody>
|
|
140
|
-
| <tr>
|
|
141
|
-
|
|
142
|
-
#data
|
|
143
|
-
<!doctype html><table>X<style> <tr>x </style> </table>
|
|
144
|
-
#errors
|
|
145
|
-
Line: 1 Col: 23 Unexpected non-space characters in table context caused voodoo mode.
|
|
146
|
-
#document
|
|
147
|
-
| <!DOCTYPE html>
|
|
148
|
-
| <html>
|
|
149
|
-
| <head>
|
|
150
|
-
| <body>
|
|
151
|
-
| "X"
|
|
152
|
-
| <table>
|
|
153
|
-
| <style>
|
|
154
|
-
| " <tr>x "
|
|
155
|
-
| " "
|
|
156
|
-
|
|
157
|
-
#data
|
|
158
|
-
<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div>
|
|
159
|
-
#errors
|
|
160
|
-
Line: 1 Col: 30 Unexpected start tag (a) in table context caused voodoo mode.
|
|
161
|
-
Line: 1 Col: 37 Unexpected end tag (a) in table context caused voodoo mode.
|
|
162
|
-
#document
|
|
163
|
-
| <!DOCTYPE html>
|
|
164
|
-
| <html>
|
|
165
|
-
| <head>
|
|
166
|
-
| <body>
|
|
167
|
-
| <div>
|
|
168
|
-
| <a>
|
|
169
|
-
| "foo"
|
|
170
|
-
| <table>
|
|
171
|
-
| " "
|
|
172
|
-
| <tbody>
|
|
173
|
-
| <tr>
|
|
174
|
-
| <td>
|
|
175
|
-
| "bar"
|
|
176
|
-
| " "
|
|
177
|
-
|
|
178
|
-
#data
|
|
179
|
-
<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes>
|
|
180
|
-
#errors
|
|
181
|
-
6: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
|
|
182
|
-
13: Stray start tag “frame”.
|
|
183
|
-
21: Stray end tag “frame”.
|
|
184
|
-
29: Stray end tag “frame”.
|
|
185
|
-
39: “frameset” start tag after “body” already open.
|
|
186
|
-
105: End of file seen inside an [R]CDATA element.
|
|
187
|
-
105: End of file seen and there were open elements.
|
|
188
|
-
XXX: These errors are wrong, please fix me!
|
|
189
|
-
#document
|
|
190
|
-
| <html>
|
|
191
|
-
| <head>
|
|
192
|
-
| <frameset>
|
|
193
|
-
| <frame>
|
|
194
|
-
| <frameset>
|
|
195
|
-
| <frame>
|
|
196
|
-
| <noframes>
|
|
197
|
-
| "</frameset><noframes>"
|
|
198
|
-
|
|
199
|
-
#data
|
|
200
|
-
<!DOCTYPE html><object></html>
|
|
201
|
-
#errors
|
|
202
|
-
1: Expected closing tag. Unexpected end of file
|
|
203
|
-
#document
|
|
204
|
-
| <!DOCTYPE html>
|
|
205
|
-
| <html>
|
|
206
|
-
| <head>
|
|
207
|
-
| <body>
|
|
208
|
-
| <object>
|