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.
Files changed (80) hide show
  1. package/.npmignore +3 -1
  2. package/LICENSE +1 -1
  3. package/README.md +166 -77
  4. package/index.js +7 -0
  5. package/lib/{html.js → const/html.js} +0 -0
  6. package/lib/{unicode.js → const/unicode.js} +0 -0
  7. package/lib/{named_entity_trie.js → tokenization_stage/named_entity_trie.js} +1 -1
  8. package/lib/tokenization_stage/parser_simulator.js +2 -0
  9. package/lib/{preprocessor.js → tokenization_stage/preprocessor.js} +5 -5
  10. package/lib/{tokenizer.js → tokenization_stage/tokenizer.js} +37 -37
  11. package/lib/{default_tree_adapter.js → tree_adapters/default.js} +47 -0
  12. package/lib/tree_adapters/htmlparser2.js +267 -0
  13. package/lib/{formatting_element_list.js → tree_construction_stage/formatting_element_list.js} +1 -1
  14. package/lib/{open_element_stack.js → tree_construction_stage/open_element_stack.js} +2 -2
  15. package/lib/{parser.js → tree_construction_stage/parser.js} +8 -8
  16. package/lib/tree_construction_stage/tree_serializer.js +165 -0
  17. package/package.json +33 -26
  18. package/test/data/tokenizer/contentModelFlags.test +0 -75
  19. package/test/data/tokenizer/domjs.test +0 -90
  20. package/test/data/tokenizer/entities.test +0 -283
  21. package/test/data/tokenizer/escapeFlag.test +0 -33
  22. package/test/data/tokenizer/namedEntities.test +0 -44189
  23. package/test/data/tokenizer/numericEntities.test +0 -1313
  24. package/test/data/tokenizer/pendingSpecChanges.test +0 -7
  25. package/test/data/tokenizer/test1.test +0 -196
  26. package/test/data/tokenizer/test2.test +0 -179
  27. package/test/data/tokenizer/test3.test +0 -6047
  28. package/test/data/tokenizer/test4.test +0 -344
  29. package/test/data/tokenizer/unicodeChars.test +0 -1295
  30. package/test/data/tokenizer/unicodeCharsProblematic.test +0 -27
  31. package/test/data/tree-construction/adoption01.dat +0 -275
  32. package/test/data/tree-construction/adoption02.dat +0 -31
  33. package/test/data/tree-construction/comments01.dat +0 -146
  34. package/test/data/tree-construction/doctype01.dat +0 -370
  35. package/test/data/tree-construction/domjs-unsafe.dat +0 -0
  36. package/test/data/tree-construction/entities01.dat +0 -603
  37. package/test/data/tree-construction/entities02.dat +0 -249
  38. package/test/data/tree-construction/html5test-com.dat +0 -246
  39. package/test/data/tree-construction/inbody01.dat +0 -43
  40. package/test/data/tree-construction/isindex.dat +0 -40
  41. package/test/data/tree-construction/main-element.dat +0 -29
  42. package/test/data/tree-construction/pending-spec-changes-plain-text-unsafe.dat +0 -0
  43. package/test/data/tree-construction/pending-spec-changes.dat +0 -52
  44. package/test/data/tree-construction/plain-text-unsafe.dat +0 -0
  45. package/test/data/tree-construction/scriptdata01.dat +0 -308
  46. package/test/data/tree-construction/tables01.dat +0 -212
  47. package/test/data/tree-construction/tests1.dat +0 -1952
  48. package/test/data/tree-construction/tests10.dat +0 -799
  49. package/test/data/tree-construction/tests11.dat +0 -482
  50. package/test/data/tree-construction/tests12.dat +0 -62
  51. package/test/data/tree-construction/tests14.dat +0 -74
  52. package/test/data/tree-construction/tests15.dat +0 -208
  53. package/test/data/tree-construction/tests16.dat +0 -2299
  54. package/test/data/tree-construction/tests17.dat +0 -153
  55. package/test/data/tree-construction/tests18.dat +0 -269
  56. package/test/data/tree-construction/tests19.dat +0 -1249
  57. package/test/data/tree-construction/tests2.dat +0 -763
  58. package/test/data/tree-construction/tests20.dat +0 -455
  59. package/test/data/tree-construction/tests21.dat +0 -257
  60. package/test/data/tree-construction/tests22.dat +0 -157
  61. package/test/data/tree-construction/tests23.dat +0 -155
  62. package/test/data/tree-construction/tests24.dat +0 -79
  63. package/test/data/tree-construction/tests25.dat +0 -219
  64. package/test/data/tree-construction/tests26.dat +0 -313
  65. package/test/data/tree-construction/tests3.dat +0 -305
  66. package/test/data/tree-construction/tests4.dat +0 -59
  67. package/test/data/tree-construction/tests5.dat +0 -191
  68. package/test/data/tree-construction/tests6.dat +0 -663
  69. package/test/data/tree-construction/tests7.dat +0 -390
  70. package/test/data/tree-construction/tests8.dat +0 -148
  71. package/test/data/tree-construction/tests9.dat +0 -457
  72. package/test/data/tree-construction/tests_innerHTML_1.dat +0 -741
  73. package/test/data/tree-construction/tricky01.dat +0 -261
  74. package/test/data/tree-construction/webkit01.dat +0 -594
  75. package/test/data/tree-construction/webkit02.dat +0 -94
  76. package/test/fixtures/formatting_element_list_test.js +0 -267
  77. package/test/fixtures/open_element_stack_test.js +0 -495
  78. package/test/fixtures/parser_test.js +0 -160
  79. package/test/fixtures/tokenizer_test.js +0 -178
  80. package/test/run_tests.js +0 -10
@@ -1,153 +0,0 @@
1
- #data
2
- <!doctype html><table><tbody><select><tr>
3
- #errors
4
- #document
5
- | <!DOCTYPE html>
6
- | <html>
7
- | <head>
8
- | <body>
9
- | <select>
10
- | <table>
11
- | <tbody>
12
- | <tr>
13
-
14
- #data
15
- <!doctype html><table><tr><select><td>
16
- #errors
17
- #document
18
- | <!DOCTYPE html>
19
- | <html>
20
- | <head>
21
- | <body>
22
- | <select>
23
- | <table>
24
- | <tbody>
25
- | <tr>
26
- | <td>
27
-
28
- #data
29
- <!doctype html><table><tr><td><select><td>
30
- #errors
31
- #document
32
- | <!DOCTYPE html>
33
- | <html>
34
- | <head>
35
- | <body>
36
- | <table>
37
- | <tbody>
38
- | <tr>
39
- | <td>
40
- | <select>
41
- | <td>
42
-
43
- #data
44
- <!doctype html><table><tr><th><select><td>
45
- #errors
46
- #document
47
- | <!DOCTYPE html>
48
- | <html>
49
- | <head>
50
- | <body>
51
- | <table>
52
- | <tbody>
53
- | <tr>
54
- | <th>
55
- | <select>
56
- | <td>
57
-
58
- #data
59
- <!doctype html><table><caption><select><tr>
60
- #errors
61
- #document
62
- | <!DOCTYPE html>
63
- | <html>
64
- | <head>
65
- | <body>
66
- | <table>
67
- | <caption>
68
- | <select>
69
- | <tbody>
70
- | <tr>
71
-
72
- #data
73
- <!doctype html><select><tr>
74
- #errors
75
- #document
76
- | <!DOCTYPE html>
77
- | <html>
78
- | <head>
79
- | <body>
80
- | <select>
81
-
82
- #data
83
- <!doctype html><select><td>
84
- #errors
85
- #document
86
- | <!DOCTYPE html>
87
- | <html>
88
- | <head>
89
- | <body>
90
- | <select>
91
-
92
- #data
93
- <!doctype html><select><th>
94
- #errors
95
- #document
96
- | <!DOCTYPE html>
97
- | <html>
98
- | <head>
99
- | <body>
100
- | <select>
101
-
102
- #data
103
- <!doctype html><select><tbody>
104
- #errors
105
- #document
106
- | <!DOCTYPE html>
107
- | <html>
108
- | <head>
109
- | <body>
110
- | <select>
111
-
112
- #data
113
- <!doctype html><select><thead>
114
- #errors
115
- #document
116
- | <!DOCTYPE html>
117
- | <html>
118
- | <head>
119
- | <body>
120
- | <select>
121
-
122
- #data
123
- <!doctype html><select><tfoot>
124
- #errors
125
- #document
126
- | <!DOCTYPE html>
127
- | <html>
128
- | <head>
129
- | <body>
130
- | <select>
131
-
132
- #data
133
- <!doctype html><select><caption>
134
- #errors
135
- #document
136
- | <!DOCTYPE html>
137
- | <html>
138
- | <head>
139
- | <body>
140
- | <select>
141
-
142
- #data
143
- <!doctype html><table><tr></table>a
144
- #errors
145
- #document
146
- | <!DOCTYPE html>
147
- | <html>
148
- | <head>
149
- | <body>
150
- | <table>
151
- | <tbody>
152
- | <tr>
153
- | "a"
@@ -1,269 +0,0 @@
1
- #data
2
- <!doctype html><plaintext></plaintext>
3
- #errors
4
- #document
5
- | <!DOCTYPE html>
6
- | <html>
7
- | <head>
8
- | <body>
9
- | <plaintext>
10
- | "</plaintext>"
11
-
12
- #data
13
- <!doctype html><table><plaintext></plaintext>
14
- #errors
15
- #document
16
- | <!DOCTYPE html>
17
- | <html>
18
- | <head>
19
- | <body>
20
- | <plaintext>
21
- | "</plaintext>"
22
- | <table>
23
-
24
- #data
25
- <!doctype html><table><tbody><plaintext></plaintext>
26
- #errors
27
- #document
28
- | <!DOCTYPE html>
29
- | <html>
30
- | <head>
31
- | <body>
32
- | <plaintext>
33
- | "</plaintext>"
34
- | <table>
35
- | <tbody>
36
-
37
- #data
38
- <!doctype html><table><tbody><tr><plaintext></plaintext>
39
- #errors
40
- #document
41
- | <!DOCTYPE html>
42
- | <html>
43
- | <head>
44
- | <body>
45
- | <plaintext>
46
- | "</plaintext>"
47
- | <table>
48
- | <tbody>
49
- | <tr>
50
-
51
- #data
52
- <!doctype html><table><tbody><tr><plaintext></plaintext>
53
- #errors
54
- #document
55
- | <!DOCTYPE html>
56
- | <html>
57
- | <head>
58
- | <body>
59
- | <plaintext>
60
- | "</plaintext>"
61
- | <table>
62
- | <tbody>
63
- | <tr>
64
-
65
- #data
66
- <!doctype html><table><td><plaintext></plaintext>
67
- #errors
68
- #document
69
- | <!DOCTYPE html>
70
- | <html>
71
- | <head>
72
- | <body>
73
- | <table>
74
- | <tbody>
75
- | <tr>
76
- | <td>
77
- | <plaintext>
78
- | "</plaintext>"
79
-
80
- #data
81
- <!doctype html><table><caption><plaintext></plaintext>
82
- #errors
83
- #document
84
- | <!DOCTYPE html>
85
- | <html>
86
- | <head>
87
- | <body>
88
- | <table>
89
- | <caption>
90
- | <plaintext>
91
- | "</plaintext>"
92
-
93
- #data
94
- <!doctype html><table><tr><style></script></style>abc
95
- #errors
96
- #document
97
- | <!DOCTYPE html>
98
- | <html>
99
- | <head>
100
- | <body>
101
- | "abc"
102
- | <table>
103
- | <tbody>
104
- | <tr>
105
- | <style>
106
- | "</script>"
107
-
108
- #data
109
- <!doctype html><table><tr><script></style></script>abc
110
- #errors
111
- #document
112
- | <!DOCTYPE html>
113
- | <html>
114
- | <head>
115
- | <body>
116
- | "abc"
117
- | <table>
118
- | <tbody>
119
- | <tr>
120
- | <script>
121
- | "</style>"
122
-
123
- #data
124
- <!doctype html><table><caption><style></script></style>abc
125
- #errors
126
- #document
127
- | <!DOCTYPE html>
128
- | <html>
129
- | <head>
130
- | <body>
131
- | <table>
132
- | <caption>
133
- | <style>
134
- | "</script>"
135
- | "abc"
136
-
137
- #data
138
- <!doctype html><table><td><style></script></style>abc
139
- #errors
140
- #document
141
- | <!DOCTYPE html>
142
- | <html>
143
- | <head>
144
- | <body>
145
- | <table>
146
- | <tbody>
147
- | <tr>
148
- | <td>
149
- | <style>
150
- | "</script>"
151
- | "abc"
152
-
153
- #data
154
- <!doctype html><select><script></style></script>abc
155
- #errors
156
- #document
157
- | <!DOCTYPE html>
158
- | <html>
159
- | <head>
160
- | <body>
161
- | <select>
162
- | <script>
163
- | "</style>"
164
- | "abc"
165
-
166
- #data
167
- <!doctype html><table><select><script></style></script>abc
168
- #errors
169
- #document
170
- | <!DOCTYPE html>
171
- | <html>
172
- | <head>
173
- | <body>
174
- | <select>
175
- | <script>
176
- | "</style>"
177
- | "abc"
178
- | <table>
179
-
180
- #data
181
- <!doctype html><table><tr><select><script></style></script>abc
182
- #errors
183
- #document
184
- | <!DOCTYPE html>
185
- | <html>
186
- | <head>
187
- | <body>
188
- | <select>
189
- | <script>
190
- | "</style>"
191
- | "abc"
192
- | <table>
193
- | <tbody>
194
- | <tr>
195
-
196
- #data
197
- <!doctype html><frameset></frameset><noframes>abc
198
- #errors
199
- #document
200
- | <!DOCTYPE html>
201
- | <html>
202
- | <head>
203
- | <frameset>
204
- | <noframes>
205
- | "abc"
206
-
207
- #data
208
- <!doctype html><frameset></frameset><noframes>abc</noframes><!--abc-->
209
- #errors
210
- #document
211
- | <!DOCTYPE html>
212
- | <html>
213
- | <head>
214
- | <frameset>
215
- | <noframes>
216
- | "abc"
217
- | <!-- abc -->
218
-
219
- #data
220
- <!doctype html><frameset></frameset></html><noframes>abc
221
- #errors
222
- #document
223
- | <!DOCTYPE html>
224
- | <html>
225
- | <head>
226
- | <frameset>
227
- | <noframes>
228
- | "abc"
229
-
230
- #data
231
- <!doctype html><frameset></frameset></html><noframes>abc</noframes><!--abc-->
232
- #errors
233
- #document
234
- | <!DOCTYPE html>
235
- | <html>
236
- | <head>
237
- | <frameset>
238
- | <noframes>
239
- | "abc"
240
- | <!-- abc -->
241
-
242
- #data
243
- <!doctype html><table><tr></tbody><tfoot>
244
- #errors
245
- #document
246
- | <!DOCTYPE html>
247
- | <html>
248
- | <head>
249
- | <body>
250
- | <table>
251
- | <tbody>
252
- | <tr>
253
- | <tfoot>
254
-
255
- #data
256
- <!doctype html><table><td><svg></svg>abc<td>
257
- #errors
258
- #document
259
- | <!DOCTYPE html>
260
- | <html>
261
- | <head>
262
- | <body>
263
- | <table>
264
- | <tbody>
265
- | <tr>
266
- | <td>
267
- | <svg svg>
268
- | "abc"
269
- | <td>