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,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>&amp;</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><!--&amp;--></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
- | "-->"