@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.
Files changed (91) hide show
  1. package/README.md +1 -7
  2. package/bun.lock +8 -3
  3. package/index.ts +4 -0
  4. package/package.json +13 -6
  5. package/src/css-selector.ts +45 -27
  6. package/src/dom-simulator.ts +162 -20
  7. package/src/encoding.ts +39 -0
  8. package/src/index.ts +9 -0
  9. package/src/parser.ts +478 -183
  10. package/src/serializer.ts +450 -0
  11. package/src/tokenizer.ts +59 -139
  12. package/tests/advanced.test.ts +119 -106
  13. package/tests/custom-elements.test.ts +172 -162
  14. package/tests/dom-extended.test.ts +12 -12
  15. package/tests/dom-manipulation.test.ts +637 -0
  16. package/tests/dom.test.ts +32 -27
  17. package/tests/helpers/tokenizer-adapter.test.ts +70 -0
  18. package/tests/helpers/tokenizer-adapter.ts +65 -0
  19. package/tests/helpers/tree-adapter.test.ts +39 -0
  20. package/tests/helpers/tree-adapter.ts +43 -0
  21. package/tests/html5lib-data/tokenizer/namedEntities.test +42422 -0
  22. package/tests/html5lib-data/tokenizer/pendingSpecChanges.test +9 -0
  23. package/tests/html5lib-data/tree-construction/adoption01.dat +354 -0
  24. package/tests/html5lib-data/tree-construction/adoption02.dat +39 -0
  25. package/tests/html5lib-data/tree-construction/domjs-unsafe.dat +0 -0
  26. package/tests/html5lib-data/tree-construction/entities02.dat +309 -0
  27. package/tests/html5lib-data/tree-construction/html5test-com.dat +301 -0
  28. package/tests/html5lib-data/tree-construction/math.dat +104 -0
  29. package/tests/html5lib-data/tree-construction/namespace-sensitivity.dat +22 -0
  30. package/tests/html5lib-data/tree-construction/noscript01.dat +237 -0
  31. package/tests/html5lib-data/tree-construction/ruby.dat +302 -0
  32. package/tests/html5lib-data/tree-construction/scriptdata01.dat +372 -0
  33. package/tests/html5lib-data/tree-construction/svg.dat +104 -0
  34. package/tests/html5lib-data/tree-construction/template.dat +1673 -0
  35. package/tests/html5lib-data/tree-construction/tests10.dat +853 -0
  36. package/tests/html5lib-data/tree-construction/tests11.dat +523 -0
  37. package/tests/html5lib-data/tree-construction/tests20.dat +842 -0
  38. package/tests/html5lib-data/tree-construction/tests21.dat +306 -0
  39. package/tests/html5lib-data/tree-construction/tests23.dat +168 -0
  40. package/tests/html5lib-data/tree-construction/tests24.dat +79 -0
  41. package/tests/html5lib-data/tree-construction/tests5.dat +210 -0
  42. package/tests/html5lib-data/tree-construction/tests6.dat +663 -0
  43. package/tests/html5lib-data/tree-construction/tests_innerHTML_1.dat +844 -0
  44. package/tests/parser.test.ts +172 -193
  45. package/tests/selectors.test.ts +64 -1
  46. package/tests/serializer-core.test.ts +16 -0
  47. package/tests/serializer-data/core.test +125 -0
  48. package/tests/serializer-data/injectmeta.test +66 -0
  49. package/tests/serializer-data/optionaltags.test +965 -0
  50. package/tests/serializer-data/options.test +60 -0
  51. package/tests/serializer-data/whitespace.test +51 -0
  52. package/tests/serializer-injectmeta.test.ts +16 -0
  53. package/tests/serializer-optionaltags.test.ts +16 -0
  54. package/tests/serializer-options.test.ts +16 -0
  55. package/tests/serializer-whitespace.test.ts +16 -0
  56. package/tests/tokenizer-namedEntities.test.ts +20 -0
  57. package/tests/tokenizer-pendingSpecChanges.test.ts +20 -0
  58. package/tests/tokenizer.test.ts +83 -0
  59. package/tests/tree-construction-adoption01.test.ts +37 -0
  60. package/tests/tree-construction-adoption02.test.ts +34 -0
  61. package/tests/tree-construction-domjs-unsafe.test.ts +24 -0
  62. package/tests/tree-construction-entities02.test.ts +33 -0
  63. package/tests/tree-construction-html5test-com.test.ts +24 -0
  64. package/tests/tree-construction-math.test.ts +18 -0
  65. package/tests/tree-construction-namespace-sensitivity.test.ts +18 -0
  66. package/tests/tree-construction-noscript01.test.ts +18 -0
  67. package/tests/tree-construction-ruby.test.ts +21 -0
  68. package/tests/tree-construction-scriptdata01.test.ts +21 -0
  69. package/tests/tree-construction-svg.test.ts +21 -0
  70. package/tests/tree-construction-template.test.ts +21 -0
  71. package/tests/tree-construction-tests10.test.ts +21 -0
  72. package/tests/tree-construction-tests11.test.ts +21 -0
  73. package/tests/tree-construction-tests20.test.ts +18 -0
  74. package/tests/tree-construction-tests21.test.ts +18 -0
  75. package/tests/tree-construction-tests23.test.ts +18 -0
  76. package/tests/tree-construction-tests24.test.ts +18 -0
  77. package/tests/tree-construction-tests5.test.ts +21 -0
  78. package/tests/tree-construction-tests6.test.ts +21 -0
  79. package/tests/tree-construction-tests_innerHTML_1.test.ts +21 -0
  80. package/tests/void-elements.test.ts +471 -0
  81. package/tests/official/README.md +0 -87
  82. package/tests/official/acid/acid-tests.test.ts +0 -309
  83. package/tests/official/final-output/final-output.test.ts +0 -361
  84. package/tests/official/html5lib/tokenizer-utils.ts +0 -192
  85. package/tests/official/html5lib/tokenizer.test.ts +0 -171
  86. package/tests/official/html5lib/tree-construction-utils.ts +0 -194
  87. package/tests/official/html5lib/tree-construction.test.ts +0 -250
  88. package/tests/official/validator/validator-tests.test.ts +0 -237
  89. package/tests/official/validator-nu/validator-nu.test.ts +0 -335
  90. package/tests/official/whatwg/whatwg-tests.test.ts +0 -205
  91. package/tests/official/wpt/wpt-tests.test.ts +0 -409
@@ -0,0 +1,302 @@
1
+ #data
2
+ <html><ruby>a<rb>b<rb></ruby></html>
3
+ #errors
4
+ (1,6): expected-doctype-but-got-start-tag
5
+ #document
6
+ | <html>
7
+ | <head>
8
+ | <body>
9
+ | <ruby>
10
+ | "a"
11
+ | <rb>
12
+ | "b"
13
+ | <rb>
14
+
15
+ #data
16
+ <html><ruby>a<rb>b<rt></ruby></html>
17
+ #errors
18
+ (1,6): expected-doctype-but-got-start-tag
19
+ #document
20
+ | <html>
21
+ | <head>
22
+ | <body>
23
+ | <ruby>
24
+ | "a"
25
+ | <rb>
26
+ | "b"
27
+ | <rt>
28
+
29
+ #data
30
+ <html><ruby>a<rb>b<rtc></ruby></html>
31
+ #errors
32
+ (1,6): expected-doctype-but-got-start-tag
33
+ #document
34
+ | <html>
35
+ | <head>
36
+ | <body>
37
+ | <ruby>
38
+ | "a"
39
+ | <rb>
40
+ | "b"
41
+ | <rtc>
42
+
43
+ #data
44
+ <html><ruby>a<rb>b<rp></ruby></html>
45
+ #errors
46
+ (1,6): expected-doctype-but-got-start-tag
47
+ #document
48
+ | <html>
49
+ | <head>
50
+ | <body>
51
+ | <ruby>
52
+ | "a"
53
+ | <rb>
54
+ | "b"
55
+ | <rp>
56
+
57
+ #data
58
+ <html><ruby>a<rb>b<span></ruby></html>
59
+ #errors
60
+ (1,6): expected-doctype-but-got-start-tag
61
+ (1,31): unexpected-end-tag
62
+ #document
63
+ | <html>
64
+ | <head>
65
+ | <body>
66
+ | <ruby>
67
+ | "a"
68
+ | <rb>
69
+ | "b"
70
+ | <span>
71
+
72
+ #data
73
+ <html><ruby>a<rt>b<rb></ruby></html>
74
+ #errors
75
+ (1,6): expected-doctype-but-got-start-tag
76
+ #document
77
+ | <html>
78
+ | <head>
79
+ | <body>
80
+ | <ruby>
81
+ | "a"
82
+ | <rt>
83
+ | "b"
84
+ | <rb>
85
+
86
+ #data
87
+ <html><ruby>a<rt>b<rt></ruby></html>
88
+ #errors
89
+ (1,6): expected-doctype-but-got-start-tag
90
+ #document
91
+ | <html>
92
+ | <head>
93
+ | <body>
94
+ | <ruby>
95
+ | "a"
96
+ | <rt>
97
+ | "b"
98
+ | <rt>
99
+
100
+ #data
101
+ <html><ruby>a<rt>b<rtc></ruby></html>
102
+ #errors
103
+ (1,6): expected-doctype-but-got-start-tag
104
+ #document
105
+ | <html>
106
+ | <head>
107
+ | <body>
108
+ | <ruby>
109
+ | "a"
110
+ | <rt>
111
+ | "b"
112
+ | <rtc>
113
+
114
+ #data
115
+ <html><ruby>a<rt>b<rp></ruby></html>
116
+ #errors
117
+ (1,6): expected-doctype-but-got-start-tag
118
+ #document
119
+ | <html>
120
+ | <head>
121
+ | <body>
122
+ | <ruby>
123
+ | "a"
124
+ | <rt>
125
+ | "b"
126
+ | <rp>
127
+
128
+ #data
129
+ <html><ruby>a<rt>b<span></ruby></html>
130
+ #errors
131
+ (1,6): expected-doctype-but-got-start-tag
132
+ (1,31): unexpected-end-tag
133
+ #document
134
+ | <html>
135
+ | <head>
136
+ | <body>
137
+ | <ruby>
138
+ | "a"
139
+ | <rt>
140
+ | "b"
141
+ | <span>
142
+
143
+ #data
144
+ <html><ruby>a<rtc>b<rb></ruby></html>
145
+ #errors
146
+ (1,6): expected-doctype-but-got-start-tag
147
+ #document
148
+ | <html>
149
+ | <head>
150
+ | <body>
151
+ | <ruby>
152
+ | "a"
153
+ | <rtc>
154
+ | "b"
155
+ | <rb>
156
+
157
+ #data
158
+ <html><ruby>a<rtc>b<rt>c<rt>d</ruby></html>
159
+ #errors
160
+ (1,6): expected-doctype-but-got-start-tag
161
+ #document
162
+ | <html>
163
+ | <head>
164
+ | <body>
165
+ | <ruby>
166
+ | "a"
167
+ | <rtc>
168
+ | "b"
169
+ | <rt>
170
+ | "c"
171
+ | <rt>
172
+ | "d"
173
+
174
+ #data
175
+ <html><ruby>a<rtc>b<rtc></ruby></html>
176
+ #errors
177
+ (1,6): expected-doctype-but-got-start-tag
178
+ #document
179
+ | <html>
180
+ | <head>
181
+ | <body>
182
+ | <ruby>
183
+ | "a"
184
+ | <rtc>
185
+ | "b"
186
+ | <rtc>
187
+
188
+ #data
189
+ <html><ruby>a<rtc>b<rp></ruby></html>
190
+ #errors
191
+ (1,6): expected-doctype-but-got-start-tag
192
+ #document
193
+ | <html>
194
+ | <head>
195
+ | <body>
196
+ | <ruby>
197
+ | "a"
198
+ | <rtc>
199
+ | "b"
200
+ | <rp>
201
+
202
+ #data
203
+ <html><ruby>a<rtc>b<span></ruby></html>
204
+ #errors
205
+ (1,6): expected-doctype-but-got-start-tag
206
+ (1,32): unexpected-end-tag
207
+ #document
208
+ | <html>
209
+ | <head>
210
+ | <body>
211
+ | <ruby>
212
+ | "a"
213
+ | <rtc>
214
+ | "b"
215
+ | <span>
216
+
217
+ #data
218
+ <html><ruby>a<rp>b<rb></ruby></html>
219
+ #errors
220
+ (1,6): expected-doctype-but-got-start-tag
221
+ #document
222
+ | <html>
223
+ | <head>
224
+ | <body>
225
+ | <ruby>
226
+ | "a"
227
+ | <rp>
228
+ | "b"
229
+ | <rb>
230
+
231
+ #data
232
+ <html><ruby>a<rp>b<rt></ruby></html>
233
+ #errors
234
+ (1,6): expected-doctype-but-got-start-tag
235
+ #document
236
+ | <html>
237
+ | <head>
238
+ | <body>
239
+ | <ruby>
240
+ | "a"
241
+ | <rp>
242
+ | "b"
243
+ | <rt>
244
+
245
+ #data
246
+ <html><ruby>a<rp>b<rtc></ruby></html>
247
+ #errors
248
+ (1,6): expected-doctype-but-got-start-tag
249
+ #document
250
+ | <html>
251
+ | <head>
252
+ | <body>
253
+ | <ruby>
254
+ | "a"
255
+ | <rp>
256
+ | "b"
257
+ | <rtc>
258
+
259
+ #data
260
+ <html><ruby>a<rp>b<rp></ruby></html>
261
+ #errors
262
+ (1,6): expected-doctype-but-got-start-tag
263
+ #document
264
+ | <html>
265
+ | <head>
266
+ | <body>
267
+ | <ruby>
268
+ | "a"
269
+ | <rp>
270
+ | "b"
271
+ | <rp>
272
+
273
+ #data
274
+ <html><ruby>a<rp>b<span></ruby></html>
275
+ #errors
276
+ (1,6): expected-doctype-but-got-start-tag
277
+ (1,31): unexpected-end-tag
278
+ #document
279
+ | <html>
280
+ | <head>
281
+ | <body>
282
+ | <ruby>
283
+ | "a"
284
+ | <rp>
285
+ | "b"
286
+ | <span>
287
+
288
+ #data
289
+ <html><ruby><rtc><ruby>a<rb>b<rt></ruby></ruby></html>
290
+ #errors
291
+ (1,6): expected-doctype-but-got-start-tag
292
+ #document
293
+ | <html>
294
+ | <head>
295
+ | <body>
296
+ | <ruby>
297
+ | <rtc>
298
+ | <ruby>
299
+ | "a"
300
+ | <rb>
301
+ | "b"
302
+ | <rt>
@@ -0,0 +1,372 @@
1
+ #data
2
+ FOO<script>'Hello'</script>BAR
3
+ #errors
4
+ (1,3): expected-doctype-but-got-chars
5
+ #document
6
+ | <html>
7
+ | <head>
8
+ | <body>
9
+ | "FOO"
10
+ | <script>
11
+ | "'Hello'"
12
+ | "BAR"
13
+
14
+ #data
15
+ FOO<script></script>BAR
16
+ #errors
17
+ (1,3): expected-doctype-but-got-chars
18
+ #document
19
+ | <html>
20
+ | <head>
21
+ | <body>
22
+ | "FOO"
23
+ | <script>
24
+ | "BAR"
25
+
26
+ #data
27
+ FOO<script></script >BAR
28
+ #errors
29
+ (1,3): expected-doctype-but-got-chars
30
+ #document
31
+ | <html>
32
+ | <head>
33
+ | <body>
34
+ | "FOO"
35
+ | <script>
36
+ | "BAR"
37
+
38
+ #data
39
+ FOO<script></script/>BAR
40
+ #errors
41
+ (1,3): expected-doctype-but-got-chars
42
+ (1,21): self-closing-flag-on-end-tag
43
+ #new-errors
44
+ (1:21) end-tag-with-trailing-solidus
45
+ #document
46
+ | <html>
47
+ | <head>
48
+ | <body>
49
+ | "FOO"
50
+ | <script>
51
+ | "BAR"
52
+
53
+ #data
54
+ FOO<script></script/ >BAR
55
+ #errors
56
+ (1,3): expected-doctype-but-got-chars
57
+ (1,20): unexpected-character-after-solidus-in-tag
58
+ #new-errors
59
+ (1:21) unexpected-solidus-in-tag
60
+ #document
61
+ | <html>
62
+ | <head>
63
+ | <body>
64
+ | "FOO"
65
+ | <script>
66
+ | "BAR"
67
+
68
+ #data
69
+ FOO<script type="text/plain"></scriptx>BAR
70
+ #errors
71
+ (1,3): expected-doctype-but-got-chars
72
+ (1,42): expected-named-closing-tag-but-got-eof
73
+ #document
74
+ | <html>
75
+ | <head>
76
+ | <body>
77
+ | "FOO"
78
+ | <script>
79
+ | type="text/plain"
80
+ | "</scriptx>BAR"
81
+
82
+ #data
83
+ FOO<script></script foo=">" dd>BAR
84
+ #errors
85
+ (1,3): expected-doctype-but-got-chars
86
+ (1,31): attributes-in-end-tag
87
+ #new-errors
88
+ (1:31) end-tag-with-attributes
89
+ #document
90
+ | <html>
91
+ | <head>
92
+ | <body>
93
+ | "FOO"
94
+ | <script>
95
+ | "BAR"
96
+
97
+ #data
98
+ FOO<script>'<'</script>BAR
99
+ #errors
100
+ (1,3): expected-doctype-but-got-chars
101
+ #document
102
+ | <html>
103
+ | <head>
104
+ | <body>
105
+ | "FOO"
106
+ | <script>
107
+ | "'<'"
108
+ | "BAR"
109
+
110
+ #data
111
+ FOO<script>'<!'</script>BAR
112
+ #errors
113
+ (1,3): expected-doctype-but-got-chars
114
+ #document
115
+ | <html>
116
+ | <head>
117
+ | <body>
118
+ | "FOO"
119
+ | <script>
120
+ | "'<!'"
121
+ | "BAR"
122
+
123
+ #data
124
+ FOO<script>'<!-'</script>BAR
125
+ #errors
126
+ (1,3): expected-doctype-but-got-chars
127
+ #document
128
+ | <html>
129
+ | <head>
130
+ | <body>
131
+ | "FOO"
132
+ | <script>
133
+ | "'<!-'"
134
+ | "BAR"
135
+
136
+ #data
137
+ FOO<script>'<!--'</script>BAR
138
+ #errors
139
+ (1,3): expected-doctype-but-got-chars
140
+ #document
141
+ | <html>
142
+ | <head>
143
+ | <body>
144
+ | "FOO"
145
+ | <script>
146
+ | "'<!--'"
147
+ | "BAR"
148
+
149
+ #data
150
+ FOO<script>'<!---'</script>BAR
151
+ #errors
152
+ (1,3): expected-doctype-but-got-chars
153
+ #document
154
+ | <html>
155
+ | <head>
156
+ | <body>
157
+ | "FOO"
158
+ | <script>
159
+ | "'<!---'"
160
+ | "BAR"
161
+
162
+ #data
163
+ FOO<script>'<!-->'</script>BAR
164
+ #errors
165
+ (1,3): expected-doctype-but-got-chars
166
+ #document
167
+ | <html>
168
+ | <head>
169
+ | <body>
170
+ | "FOO"
171
+ | <script>
172
+ | "'<!-->'"
173
+ | "BAR"
174
+
175
+ #data
176
+ FOO<script>'<!-- potato'</script>BAR
177
+ #errors
178
+ (1,3): expected-doctype-but-got-chars
179
+ #document
180
+ | <html>
181
+ | <head>
182
+ | <body>
183
+ | "FOO"
184
+ | <script>
185
+ | "'<!-- potato'"
186
+ | "BAR"
187
+
188
+ #data
189
+ FOO<script>'<!-- <sCrIpt'</script>BAR
190
+ #errors
191
+ (1,3): expected-doctype-but-got-chars
192
+ #document
193
+ | <html>
194
+ | <head>
195
+ | <body>
196
+ | "FOO"
197
+ | <script>
198
+ | "'<!-- <sCrIpt'"
199
+ | "BAR"
200
+
201
+ #data
202
+ FOO<script type="text/plain">'<!-- <sCrIpt>'</script>BAR
203
+ #errors
204
+ (1,3): expected-doctype-but-got-chars
205
+ (1,56): expected-script-data-but-got-eof
206
+ (1,56): expected-named-closing-tag-but-got-eof
207
+ #new-errors
208
+ (1:57) eof-in-script-html-comment-like-text
209
+ #document
210
+ | <html>
211
+ | <head>
212
+ | <body>
213
+ | "FOO"
214
+ | <script>
215
+ | type="text/plain"
216
+ | "'<!-- <sCrIpt>'</script>BAR"
217
+
218
+ #data
219
+ FOO<script type="text/plain">'<!-- <sCrIpt> -'</script>BAR
220
+ #errors
221
+ (1,3): expected-doctype-but-got-chars
222
+ (1,58): expected-script-data-but-got-eof
223
+ (1,58): expected-named-closing-tag-but-got-eof
224
+ #new-errors
225
+ (1:59) eof-in-script-html-comment-like-text
226
+ #document
227
+ | <html>
228
+ | <head>
229
+ | <body>
230
+ | "FOO"
231
+ | <script>
232
+ | type="text/plain"
233
+ | "'<!-- <sCrIpt> -'</script>BAR"
234
+
235
+ #data
236
+ FOO<script type="text/plain">'<!-- <sCrIpt> --'</script>BAR
237
+ #errors
238
+ (1,3): expected-doctype-but-got-chars
239
+ (1,59): expected-script-data-but-got-eof
240
+ (1,59): expected-named-closing-tag-but-got-eof
241
+ #new-errors
242
+ (1:60) eof-in-script-html-comment-like-text
243
+ #document
244
+ | <html>
245
+ | <head>
246
+ | <body>
247
+ | "FOO"
248
+ | <script>
249
+ | type="text/plain"
250
+ | "'<!-- <sCrIpt> --'</script>BAR"
251
+
252
+ #data
253
+ FOO<script>'<!-- <sCrIpt> -->'</script>BAR
254
+ #errors
255
+ (1,3): expected-doctype-but-got-chars
256
+ #document
257
+ | <html>
258
+ | <head>
259
+ | <body>
260
+ | "FOO"
261
+ | <script>
262
+ | "'<!-- <sCrIpt> -->'"
263
+ | "BAR"
264
+
265
+ #data
266
+ FOO<script type="text/plain">'<!-- <sCrIpt> --!>'</script>BAR
267
+ #errors
268
+ (1,3): expected-doctype-but-got-chars
269
+ (1,61): expected-script-data-but-got-eof
270
+ (1,61): expected-named-closing-tag-but-got-eof
271
+ #new-errors
272
+ (1:62) eof-in-script-html-comment-like-text
273
+ #document
274
+ | <html>
275
+ | <head>
276
+ | <body>
277
+ | "FOO"
278
+ | <script>
279
+ | type="text/plain"
280
+ | "'<!-- <sCrIpt> --!>'</script>BAR"
281
+
282
+ #data
283
+ FOO<script type="text/plain">'<!-- <sCrIpt> -- >'</script>BAR
284
+ #errors
285
+ (1,3): expected-doctype-but-got-chars
286
+ (1,61): expected-script-data-but-got-eof
287
+ (1,61): expected-named-closing-tag-but-got-eof
288
+ #new-errors
289
+ (1:62) eof-in-script-html-comment-like-text
290
+ #document
291
+ | <html>
292
+ | <head>
293
+ | <body>
294
+ | "FOO"
295
+ | <script>
296
+ | type="text/plain"
297
+ | "'<!-- <sCrIpt> -- >'</script>BAR"
298
+
299
+ #data
300
+ FOO<script type="text/plain">'<!-- <sCrIpt '</script>BAR
301
+ #errors
302
+ (1,3): expected-doctype-but-got-chars
303
+ (1,56): expected-script-data-but-got-eof
304
+ (1,56): expected-named-closing-tag-but-got-eof
305
+ #new-errors
306
+ (1:57) eof-in-script-html-comment-like-text
307
+ #document
308
+ | <html>
309
+ | <head>
310
+ | <body>
311
+ | "FOO"
312
+ | <script>
313
+ | type="text/plain"
314
+ | "'<!-- <sCrIpt '</script>BAR"
315
+
316
+ #data
317
+ FOO<script type="text/plain">'<!-- <sCrIpt/'</script>BAR
318
+ #errors
319
+ (1,3): expected-doctype-but-got-chars
320
+ (1,56): expected-script-data-but-got-eof
321
+ (1,56): expected-named-closing-tag-but-got-eof
322
+ #new-errors
323
+ (1:57) eof-in-script-html-comment-like-text
324
+ #document
325
+ | <html>
326
+ | <head>
327
+ | <body>
328
+ | "FOO"
329
+ | <script>
330
+ | type="text/plain"
331
+ | "'<!-- <sCrIpt/'</script>BAR"
332
+
333
+ #data
334
+ FOO<script type="text/plain">'<!-- <sCrIpt\'</script>BAR
335
+ #errors
336
+ (1,3): expected-doctype-but-got-chars
337
+ #document
338
+ | <html>
339
+ | <head>
340
+ | <body>
341
+ | "FOO"
342
+ | <script>
343
+ | type="text/plain"
344
+ | "'<!-- <sCrIpt\'"
345
+ | "BAR"
346
+
347
+ #data
348
+ FOO<script type="text/plain">'<!-- <sCrIpt/'</script>BAR</script>QUX
349
+ #errors
350
+ (1,3): expected-doctype-but-got-chars
351
+ #document
352
+ | <html>
353
+ | <head>
354
+ | <body>
355
+ | "FOO"
356
+ | <script>
357
+ | type="text/plain"
358
+ | "'<!-- <sCrIpt/'</script>BAR"
359
+ | "QUX"
360
+
361
+ #data
362
+ FOO<script><!--<script>-></script>--></script>QUX
363
+ #errors
364
+ (1,3): expected-doctype-but-got-chars
365
+ #document
366
+ | <html>
367
+ | <head>
368
+ | <body>
369
+ | "FOO"
370
+ | <script>
371
+ | "<!--<script>-></script>-->"
372
+ | "QUX"