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,191 +0,0 @@
|
|
|
1
|
-
#data
|
|
2
|
-
<style> <!-- </style>x
|
|
3
|
-
#errors
|
|
4
|
-
Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
|
|
5
|
-
Line: 1 Col: 22 Unexpected end of file. Expected end tag (style).
|
|
6
|
-
#document
|
|
7
|
-
| <html>
|
|
8
|
-
| <head>
|
|
9
|
-
| <style>
|
|
10
|
-
| " <!-- "
|
|
11
|
-
| <body>
|
|
12
|
-
| "x"
|
|
13
|
-
|
|
14
|
-
#data
|
|
15
|
-
<style> <!-- </style> --> </style>x
|
|
16
|
-
#errors
|
|
17
|
-
Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
|
|
18
|
-
#document
|
|
19
|
-
| <html>
|
|
20
|
-
| <head>
|
|
21
|
-
| <style>
|
|
22
|
-
| " <!-- "
|
|
23
|
-
| " "
|
|
24
|
-
| <body>
|
|
25
|
-
| "--> x"
|
|
26
|
-
|
|
27
|
-
#data
|
|
28
|
-
<style> <!--> </style>x
|
|
29
|
-
#errors
|
|
30
|
-
Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
|
|
31
|
-
#document
|
|
32
|
-
| <html>
|
|
33
|
-
| <head>
|
|
34
|
-
| <style>
|
|
35
|
-
| " <!--> "
|
|
36
|
-
| <body>
|
|
37
|
-
| "x"
|
|
38
|
-
|
|
39
|
-
#data
|
|
40
|
-
<style> <!---> </style>x
|
|
41
|
-
#errors
|
|
42
|
-
Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
|
|
43
|
-
#document
|
|
44
|
-
| <html>
|
|
45
|
-
| <head>
|
|
46
|
-
| <style>
|
|
47
|
-
| " <!---> "
|
|
48
|
-
| <body>
|
|
49
|
-
| "x"
|
|
50
|
-
|
|
51
|
-
#data
|
|
52
|
-
<iframe> <!---> </iframe>x
|
|
53
|
-
#errors
|
|
54
|
-
Line: 1 Col: 8 Unexpected start tag (iframe). Expected DOCTYPE.
|
|
55
|
-
#document
|
|
56
|
-
| <html>
|
|
57
|
-
| <head>
|
|
58
|
-
| <body>
|
|
59
|
-
| <iframe>
|
|
60
|
-
| " <!---> "
|
|
61
|
-
| "x"
|
|
62
|
-
|
|
63
|
-
#data
|
|
64
|
-
<iframe> <!--- </iframe>->x</iframe> --> </iframe>x
|
|
65
|
-
#errors
|
|
66
|
-
Line: 1 Col: 8 Unexpected start tag (iframe). Expected DOCTYPE.
|
|
67
|
-
#document
|
|
68
|
-
| <html>
|
|
69
|
-
| <head>
|
|
70
|
-
| <body>
|
|
71
|
-
| <iframe>
|
|
72
|
-
| " <!--- "
|
|
73
|
-
| "->x --> x"
|
|
74
|
-
|
|
75
|
-
#data
|
|
76
|
-
<script> <!-- </script> --> </script>x
|
|
77
|
-
#errors
|
|
78
|
-
Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE.
|
|
79
|
-
#document
|
|
80
|
-
| <html>
|
|
81
|
-
| <head>
|
|
82
|
-
| <script>
|
|
83
|
-
| " <!-- "
|
|
84
|
-
| " "
|
|
85
|
-
| <body>
|
|
86
|
-
| "--> x"
|
|
87
|
-
|
|
88
|
-
#data
|
|
89
|
-
<title> <!-- </title> --> </title>x
|
|
90
|
-
#errors
|
|
91
|
-
Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
|
|
92
|
-
#document
|
|
93
|
-
| <html>
|
|
94
|
-
| <head>
|
|
95
|
-
| <title>
|
|
96
|
-
| " <!-- "
|
|
97
|
-
| " "
|
|
98
|
-
| <body>
|
|
99
|
-
| "--> x"
|
|
100
|
-
|
|
101
|
-
#data
|
|
102
|
-
<textarea> <!--- </textarea>->x</textarea> --> </textarea>x
|
|
103
|
-
#errors
|
|
104
|
-
Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE.
|
|
105
|
-
#document
|
|
106
|
-
| <html>
|
|
107
|
-
| <head>
|
|
108
|
-
| <body>
|
|
109
|
-
| <textarea>
|
|
110
|
-
| " <!--- "
|
|
111
|
-
| "->x --> x"
|
|
112
|
-
|
|
113
|
-
#data
|
|
114
|
-
<style> <!</-- </style>x
|
|
115
|
-
#errors
|
|
116
|
-
Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
|
|
117
|
-
#document
|
|
118
|
-
| <html>
|
|
119
|
-
| <head>
|
|
120
|
-
| <style>
|
|
121
|
-
| " <!</-- "
|
|
122
|
-
| <body>
|
|
123
|
-
| "x"
|
|
124
|
-
|
|
125
|
-
#data
|
|
126
|
-
<p><xmp></xmp>
|
|
127
|
-
#errors
|
|
128
|
-
XXX: Unknown
|
|
129
|
-
#document
|
|
130
|
-
| <html>
|
|
131
|
-
| <head>
|
|
132
|
-
| <body>
|
|
133
|
-
| <p>
|
|
134
|
-
| <xmp>
|
|
135
|
-
|
|
136
|
-
#data
|
|
137
|
-
<xmp> <!-- > --> </xmp>
|
|
138
|
-
#errors
|
|
139
|
-
Line: 1 Col: 5 Unexpected start tag (xmp). Expected DOCTYPE.
|
|
140
|
-
#document
|
|
141
|
-
| <html>
|
|
142
|
-
| <head>
|
|
143
|
-
| <body>
|
|
144
|
-
| <xmp>
|
|
145
|
-
| " <!-- > --> "
|
|
146
|
-
|
|
147
|
-
#data
|
|
148
|
-
<title>&</title>
|
|
149
|
-
#errors
|
|
150
|
-
Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
|
|
151
|
-
#document
|
|
152
|
-
| <html>
|
|
153
|
-
| <head>
|
|
154
|
-
| <title>
|
|
155
|
-
| "&"
|
|
156
|
-
| <body>
|
|
157
|
-
|
|
158
|
-
#data
|
|
159
|
-
<title><!--&--></title>
|
|
160
|
-
#errors
|
|
161
|
-
Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
|
|
162
|
-
#document
|
|
163
|
-
| <html>
|
|
164
|
-
| <head>
|
|
165
|
-
| <title>
|
|
166
|
-
| "<!--&-->"
|
|
167
|
-
| <body>
|
|
168
|
-
|
|
169
|
-
#data
|
|
170
|
-
<title><!--</title>
|
|
171
|
-
#errors
|
|
172
|
-
Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
|
|
173
|
-
Line: 1 Col: 19 Unexpected end of file. Expected end tag (title).
|
|
174
|
-
#document
|
|
175
|
-
| <html>
|
|
176
|
-
| <head>
|
|
177
|
-
| <title>
|
|
178
|
-
| "<!--"
|
|
179
|
-
| <body>
|
|
180
|
-
|
|
181
|
-
#data
|
|
182
|
-
<noscript><!--</noscript>--></noscript>
|
|
183
|
-
#errors
|
|
184
|
-
Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE.
|
|
185
|
-
#document
|
|
186
|
-
| <html>
|
|
187
|
-
| <head>
|
|
188
|
-
| <noscript>
|
|
189
|
-
| "<!--"
|
|
190
|
-
| <body>
|
|
191
|
-
| "-->"
|