@tkeron/html-parser 0.1.5 → 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/README.md +1 -7
- package/bun.lock +8 -3
- package/index.ts +4 -0
- package/package.json +13 -6
- package/src/css-selector.ts +45 -27
- package/src/dom-simulator.ts +162 -20
- package/src/encoding.ts +39 -0
- package/src/index.ts +9 -0
- package/src/parser.ts +478 -183
- package/src/serializer.ts +450 -0
- package/src/tokenizer.ts +59 -139
- package/tests/advanced.test.ts +119 -106
- package/tests/custom-elements.test.ts +172 -162
- package/tests/dom-extended.test.ts +12 -12
- package/tests/dom-manipulation.test.ts +637 -0
- package/tests/dom.test.ts +32 -27
- package/tests/helpers/tokenizer-adapter.test.ts +70 -0
- package/tests/helpers/tokenizer-adapter.ts +65 -0
- package/tests/helpers/tree-adapter.test.ts +39 -0
- package/tests/helpers/tree-adapter.ts +43 -0
- package/tests/html5lib-data/tokenizer/namedEntities.test +42422 -0
- package/tests/html5lib-data/tokenizer/pendingSpecChanges.test +9 -0
- package/tests/html5lib-data/tree-construction/adoption01.dat +354 -0
- package/tests/html5lib-data/tree-construction/adoption02.dat +39 -0
- package/tests/html5lib-data/tree-construction/domjs-unsafe.dat +0 -0
- package/tests/html5lib-data/tree-construction/entities02.dat +309 -0
- package/tests/html5lib-data/tree-construction/html5test-com.dat +301 -0
- package/tests/html5lib-data/tree-construction/math.dat +104 -0
- package/tests/html5lib-data/tree-construction/namespace-sensitivity.dat +22 -0
- package/tests/html5lib-data/tree-construction/noscript01.dat +237 -0
- package/tests/html5lib-data/tree-construction/ruby.dat +302 -0
- package/tests/html5lib-data/tree-construction/scriptdata01.dat +372 -0
- package/tests/html5lib-data/tree-construction/svg.dat +104 -0
- package/tests/html5lib-data/tree-construction/template.dat +1673 -0
- package/tests/html5lib-data/tree-construction/tests10.dat +853 -0
- package/tests/html5lib-data/tree-construction/tests11.dat +523 -0
- package/tests/html5lib-data/tree-construction/tests20.dat +842 -0
- package/tests/html5lib-data/tree-construction/tests21.dat +306 -0
- package/tests/html5lib-data/tree-construction/tests23.dat +168 -0
- package/tests/html5lib-data/tree-construction/tests24.dat +79 -0
- package/tests/html5lib-data/tree-construction/tests5.dat +210 -0
- package/tests/html5lib-data/tree-construction/tests6.dat +663 -0
- package/tests/html5lib-data/tree-construction/tests_innerHTML_1.dat +844 -0
- package/tests/parser.test.ts +172 -193
- package/tests/selectors.test.ts +64 -1
- package/tests/serializer-core.test.ts +16 -0
- package/tests/serializer-data/core.test +125 -0
- package/tests/serializer-data/injectmeta.test +66 -0
- package/tests/serializer-data/optionaltags.test +965 -0
- package/tests/serializer-data/options.test +60 -0
- package/tests/serializer-data/whitespace.test +51 -0
- package/tests/serializer-injectmeta.test.ts +16 -0
- package/tests/serializer-optionaltags.test.ts +16 -0
- package/tests/serializer-options.test.ts +16 -0
- package/tests/serializer-whitespace.test.ts +16 -0
- package/tests/tokenizer-namedEntities.test.ts +20 -0
- package/tests/tokenizer-pendingSpecChanges.test.ts +20 -0
- package/tests/tokenizer.test.ts +83 -0
- package/tests/tree-construction-adoption01.test.ts +37 -0
- package/tests/tree-construction-adoption02.test.ts +34 -0
- package/tests/tree-construction-domjs-unsafe.test.ts +24 -0
- package/tests/tree-construction-entities02.test.ts +33 -0
- package/tests/tree-construction-html5test-com.test.ts +24 -0
- package/tests/tree-construction-math.test.ts +18 -0
- package/tests/tree-construction-namespace-sensitivity.test.ts +18 -0
- package/tests/tree-construction-noscript01.test.ts +18 -0
- package/tests/tree-construction-ruby.test.ts +21 -0
- package/tests/tree-construction-scriptdata01.test.ts +21 -0
- package/tests/tree-construction-svg.test.ts +21 -0
- package/tests/tree-construction-template.test.ts +21 -0
- package/tests/tree-construction-tests10.test.ts +21 -0
- package/tests/tree-construction-tests11.test.ts +21 -0
- package/tests/tree-construction-tests20.test.ts +18 -0
- package/tests/tree-construction-tests21.test.ts +18 -0
- package/tests/tree-construction-tests23.test.ts +18 -0
- package/tests/tree-construction-tests24.test.ts +18 -0
- package/tests/tree-construction-tests5.test.ts +21 -0
- package/tests/tree-construction-tests6.test.ts +21 -0
- package/tests/tree-construction-tests_innerHTML_1.test.ts +21 -0
- package/tests/void-elements.test.ts +471 -0
- package/tests/official/README.md +0 -87
- package/tests/official/acid/acid-tests.test.ts +0 -309
- package/tests/official/final-output/final-output.test.ts +0 -361
- package/tests/official/html5lib/tokenizer-utils.ts +0 -192
- package/tests/official/html5lib/tokenizer.test.ts +0 -171
- package/tests/official/html5lib/tree-construction-utils.ts +0 -194
- package/tests/official/html5lib/tree-construction.test.ts +0 -250
- package/tests/official/validator/validator-tests.test.ts +0 -237
- package/tests/official/validator-nu/validator-nu.test.ts +0 -335
- package/tests/official/whatwg/whatwg-tests.test.ts +0 -205
- package/tests/official/wpt/wpt-tests.test.ts +0 -409
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
#data
|
|
2
|
+
<style> <!-- </style>x
|
|
3
|
+
#errors
|
|
4
|
+
(1,7): expected-doctype-but-got-start-tag
|
|
5
|
+
#document
|
|
6
|
+
| <html>
|
|
7
|
+
| <head>
|
|
8
|
+
| <style>
|
|
9
|
+
| " <!-- "
|
|
10
|
+
| <body>
|
|
11
|
+
| "x"
|
|
12
|
+
|
|
13
|
+
#data
|
|
14
|
+
<style> <!-- </style> --> </style>x
|
|
15
|
+
#errors
|
|
16
|
+
(1,7): expected-doctype-but-got-start-tag
|
|
17
|
+
(1,34): unexpected-end-tag
|
|
18
|
+
#document
|
|
19
|
+
| <html>
|
|
20
|
+
| <head>
|
|
21
|
+
| <style>
|
|
22
|
+
| " <!-- "
|
|
23
|
+
| " "
|
|
24
|
+
| <body>
|
|
25
|
+
| "--> x"
|
|
26
|
+
|
|
27
|
+
#data
|
|
28
|
+
<style> <!--> </style>x
|
|
29
|
+
#errors
|
|
30
|
+
(1,7): expected-doctype-but-got-start-tag
|
|
31
|
+
#document
|
|
32
|
+
| <html>
|
|
33
|
+
| <head>
|
|
34
|
+
| <style>
|
|
35
|
+
| " <!--> "
|
|
36
|
+
| <body>
|
|
37
|
+
| "x"
|
|
38
|
+
|
|
39
|
+
#data
|
|
40
|
+
<style> <!---> </style>x
|
|
41
|
+
#errors
|
|
42
|
+
(1,7): expected-doctype-but-got-start-tag
|
|
43
|
+
#document
|
|
44
|
+
| <html>
|
|
45
|
+
| <head>
|
|
46
|
+
| <style>
|
|
47
|
+
| " <!---> "
|
|
48
|
+
| <body>
|
|
49
|
+
| "x"
|
|
50
|
+
|
|
51
|
+
#data
|
|
52
|
+
<iframe> <!---> </iframe>x
|
|
53
|
+
#errors
|
|
54
|
+
(1,8): expected-doctype-but-got-start-tag
|
|
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
|
+
(1,8): expected-doctype-but-got-start-tag
|
|
67
|
+
(1,36): unexpected-end-tag
|
|
68
|
+
(1,50): unexpected-end-tag
|
|
69
|
+
#document
|
|
70
|
+
| <html>
|
|
71
|
+
| <head>
|
|
72
|
+
| <body>
|
|
73
|
+
| <iframe>
|
|
74
|
+
| " <!--- "
|
|
75
|
+
| "->x --> x"
|
|
76
|
+
|
|
77
|
+
#data
|
|
78
|
+
<script> <!-- </script> --> </script>x
|
|
79
|
+
#errors
|
|
80
|
+
(1,8): expected-doctype-but-got-start-tag
|
|
81
|
+
(1,37): unexpected-end-tag
|
|
82
|
+
#document
|
|
83
|
+
| <html>
|
|
84
|
+
| <head>
|
|
85
|
+
| <script>
|
|
86
|
+
| " <!-- "
|
|
87
|
+
| " "
|
|
88
|
+
| <body>
|
|
89
|
+
| "--> x"
|
|
90
|
+
|
|
91
|
+
#data
|
|
92
|
+
<title> <!-- </title> --> </title>x
|
|
93
|
+
#errors
|
|
94
|
+
(1,7): expected-doctype-but-got-start-tag
|
|
95
|
+
(1,34): unexpected-end-tag
|
|
96
|
+
#document
|
|
97
|
+
| <html>
|
|
98
|
+
| <head>
|
|
99
|
+
| <title>
|
|
100
|
+
| " <!-- "
|
|
101
|
+
| " "
|
|
102
|
+
| <body>
|
|
103
|
+
| "--> x"
|
|
104
|
+
|
|
105
|
+
#data
|
|
106
|
+
<textarea> <!--- </textarea>->x</textarea> --> </textarea>x
|
|
107
|
+
#errors
|
|
108
|
+
(1,10): expected-doctype-but-got-start-tag
|
|
109
|
+
(1,42): unexpected-end-tag
|
|
110
|
+
(1,58): unexpected-end-tag
|
|
111
|
+
#document
|
|
112
|
+
| <html>
|
|
113
|
+
| <head>
|
|
114
|
+
| <body>
|
|
115
|
+
| <textarea>
|
|
116
|
+
| " <!--- "
|
|
117
|
+
| "->x --> x"
|
|
118
|
+
|
|
119
|
+
#data
|
|
120
|
+
<style> <!</-- </style>x
|
|
121
|
+
#errors
|
|
122
|
+
(1,7): expected-doctype-but-got-start-tag
|
|
123
|
+
#document
|
|
124
|
+
| <html>
|
|
125
|
+
| <head>
|
|
126
|
+
| <style>
|
|
127
|
+
| " <!</-- "
|
|
128
|
+
| <body>
|
|
129
|
+
| "x"
|
|
130
|
+
|
|
131
|
+
#data
|
|
132
|
+
<p><xmp></xmp>
|
|
133
|
+
#errors
|
|
134
|
+
(1,3): expected-doctype-but-got-start-tag
|
|
135
|
+
#document
|
|
136
|
+
| <html>
|
|
137
|
+
| <head>
|
|
138
|
+
| <body>
|
|
139
|
+
| <p>
|
|
140
|
+
| <xmp>
|
|
141
|
+
|
|
142
|
+
#data
|
|
143
|
+
<xmp> <!-- > --> </xmp>
|
|
144
|
+
#errors
|
|
145
|
+
(1,5): expected-doctype-but-got-start-tag
|
|
146
|
+
#document
|
|
147
|
+
| <html>
|
|
148
|
+
| <head>
|
|
149
|
+
| <body>
|
|
150
|
+
| <xmp>
|
|
151
|
+
| " <!-- > --> "
|
|
152
|
+
|
|
153
|
+
#data
|
|
154
|
+
<title>&</title>
|
|
155
|
+
#errors
|
|
156
|
+
(1,7): expected-doctype-but-got-start-tag
|
|
157
|
+
#document
|
|
158
|
+
| <html>
|
|
159
|
+
| <head>
|
|
160
|
+
| <title>
|
|
161
|
+
| "&"
|
|
162
|
+
| <body>
|
|
163
|
+
|
|
164
|
+
#data
|
|
165
|
+
<title><!--&--></title>
|
|
166
|
+
#errors
|
|
167
|
+
(1,7): expected-doctype-but-got-start-tag
|
|
168
|
+
#document
|
|
169
|
+
| <html>
|
|
170
|
+
| <head>
|
|
171
|
+
| <title>
|
|
172
|
+
| "<!--&-->"
|
|
173
|
+
| <body>
|
|
174
|
+
|
|
175
|
+
#data
|
|
176
|
+
<title><!--</title>
|
|
177
|
+
#errors
|
|
178
|
+
(1,7): expected-doctype-but-got-start-tag
|
|
179
|
+
#document
|
|
180
|
+
| <html>
|
|
181
|
+
| <head>
|
|
182
|
+
| <title>
|
|
183
|
+
| "<!--"
|
|
184
|
+
| <body>
|
|
185
|
+
|
|
186
|
+
#data
|
|
187
|
+
<noscript><!--</noscript>--></noscript>
|
|
188
|
+
#errors
|
|
189
|
+
(1,10): expected-doctype-but-got-start-tag
|
|
190
|
+
(1,39): unexpected-end-tag
|
|
191
|
+
#script-on
|
|
192
|
+
#document
|
|
193
|
+
| <html>
|
|
194
|
+
| <head>
|
|
195
|
+
| <noscript>
|
|
196
|
+
| "<!--"
|
|
197
|
+
| <body>
|
|
198
|
+
| "-->"
|
|
199
|
+
|
|
200
|
+
#data
|
|
201
|
+
<noscript><!--</noscript>--></noscript>
|
|
202
|
+
#errors
|
|
203
|
+
(1,10): expected-doctype-but-got-start-tag
|
|
204
|
+
#script-off
|
|
205
|
+
#document
|
|
206
|
+
| <html>
|
|
207
|
+
| <head>
|
|
208
|
+
| <noscript>
|
|
209
|
+
| <!-- </noscript> -->
|
|
210
|
+
| <body>
|