|
25 | 25 | ]
|
26 | 26 | },
|
27 | 27 | {
|
28 |
| - "description":"NUL in RCDATA, RAWTEXT, PLAINTEXT and Script data", |
| 28 | + "description":"Raw NUL replacement", |
29 | 29 | "doubleEscaped":true,
|
30 | 30 | "initialStates":["RCDATA state", "RAWTEXT state", "PLAINTEXT state", "Script data state"],
|
31 | 31 | "input":"\\u0000",
|
|
34 | 34 | { "code": "unexpected-null-character", "line": 1, "col": 1 }
|
35 | 35 | ]
|
36 | 36 | },
|
| 37 | + { |
| 38 | + "description":"NUL in CDATA section", |
| 39 | + "doubleEscaped":true, |
| 40 | + "initialStates":["CDATA section state"], |
| 41 | + "input":"\\u0000]]>", |
| 42 | + "output":[["Character", "\\u0000"]] |
| 43 | + }, |
37 | 44 | {
|
38 | 45 | "description":"NUL in script HTML comment",
|
39 | 46 | "doubleEscaped":true,
|
|
112 | 119 | { "code": "eof-in-script-html-comment-like-text", "line": 1, "col": 13 }
|
113 | 120 | ]
|
114 | 121 | },
|
| 122 | + { |
| 123 | + "description":"Dash in script HTML comment", |
| 124 | + "initialStates":["Script data state"], |
| 125 | + "input":"<!-- - -->", |
| 126 | + "output":[["Character", "<!-- - -->"]] |
| 127 | + }, |
| 128 | + { |
| 129 | + "description":"Dash less-than in script HTML comment", |
| 130 | + "initialStates":["Script data state"], |
| 131 | + "input":"<!-- -< -->", |
| 132 | + "output":[["Character", "<!-- -< -->"]] |
| 133 | + }, |
| 134 | + { |
| 135 | + "description":"Dash at end of script HTML comment", |
| 136 | + "initialStates":["Script data state"], |
| 137 | + "input":"<!--test--->", |
| 138 | + "output":[["Character", "<!--test--->"]] |
| 139 | + }, |
| 140 | + { |
| 141 | + "description":"</script> in script HTML comment", |
| 142 | + "initialStates":["Script data state"], |
| 143 | + "lastStartTag":"script", |
| 144 | + "input":"<!-- </script> --></script>", |
| 145 | + "output":[["Character", "<!-- "], ["EndTag", "script"], ["Character", " -->"], ["EndTag", "script"]] |
| 146 | + }, |
| 147 | + { |
| 148 | + "description":"</script> in script HTML comment - double escaped", |
| 149 | + "initialStates":["Script data state"], |
| 150 | + "lastStartTag":"script", |
| 151 | + "input":"<!-- <script></script> --></script>", |
| 152 | + "output":[["Character", "<!-- <script></script> -->"], ["EndTag", "script"]] |
| 153 | + }, |
| 154 | + { |
| 155 | + "description":"</script> in script HTML comment - double escaped with nested <script>", |
| 156 | + "initialStates":["Script data state"], |
| 157 | + "lastStartTag":"script", |
| 158 | + "input":"<!-- <script><script></script></script> --></script>", |
| 159 | + "output":[["Character", "<!-- <script><script></script>"], ["EndTag", "script"], ["Character", " -->"], ["EndTag", "script"]] |
| 160 | + }, |
| 161 | + { |
| 162 | + "description":"</script> in script HTML comment - double escaped with abrupt end", |
| 163 | + "initialStates":["Script data state"], |
| 164 | + "lastStartTag":"script", |
| 165 | + "input":"<!-- <script>--></script> --></script>", |
| 166 | + "output":[["Character", "<!-- <script>-->"], ["EndTag", "script"], ["Character", " -->"], ["EndTag", "script"]] |
| 167 | + }, |
| 168 | + { |
| 169 | + "description":"Incomplete start tag in script HTML comment double escaped", |
| 170 | + "initialStates":["Script data state"], |
| 171 | + "lastStartTag":"script", |
| 172 | + "input":"<!--<scrip></script>-->", |
| 173 | + "output":[["Character", "<!--<scrip>"], ["EndTag", "script"], ["Character", "-->"]] |
| 174 | + }, |
| 175 | + { |
| 176 | + "description":"Unclosed start tag in script HTML comment double escaped", |
| 177 | + "initialStates":["Script data state"], |
| 178 | + "lastStartTag":"script", |
| 179 | + "input":"<!--<script</script>-->", |
| 180 | + "output":[["Character", "<!--<script"], ["EndTag", "script"], ["Character", "-->"]] |
| 181 | + }, |
| 182 | + { |
| 183 | + "description":"Incomplete end tag in script HTML comment double escaped", |
| 184 | + "initialStates":["Script data state"], |
| 185 | + "lastStartTag":"script", |
| 186 | + "input":"<!--<script></scrip>-->", |
| 187 | + "output":[["Character", "<!--<script></scrip>-->"]] |
| 188 | + }, |
| 189 | + { |
| 190 | + "description":"Unclosed end tag in script HTML comment double escaped", |
| 191 | + "initialStates":["Script data state"], |
| 192 | + "lastStartTag":"script", |
| 193 | + "input":"<!--<script></script-->", |
| 194 | + "output":[["Character", "<!--<script></script-->"]] |
| 195 | + }, |
115 | 196 | {
|
116 | 197 | "description":"leading U+FEFF must pass through",
|
| 198 | + "initialStates":["Data state", "RCDATA state", "RAWTEXT state", "Script data state"], |
117 | 199 | "doubleEscaped":true,
|
118 | 200 | "input":"\\uFEFFfoo\\uFEFFbar",
|
119 | 201 | "output":[["Character", "\\uFEFFfoo\\uFEFFbar"]]
|
120 | 202 | },
|
121 | 203 | {
|
122 |
| - "description":"Non BMP-charref in in RCDATA", |
| 204 | + "description":"Non BMP-charref in RCDATA", |
123 | 205 | "initialStates":["RCDATA state"],
|
124 | 206 | "input":"≂̸",
|
125 | 207 | "output":[["Character", "\u2242\u0338"]]
|
126 | 208 | },
|
127 | 209 | {
|
128 |
| - "description":"Bad charref in in RCDATA", |
| 210 | + "description":"Bad charref in RCDATA", |
129 | 211 | "initialStates":["RCDATA state"],
|
130 | 212 | "input":"&NotEqualTild;",
|
131 | 213 | "output":[["Character", "&NotEqualTild;"]],
|
|
134 | 216 | ]
|
135 | 217 | },
|
136 | 218 | {
|
137 |
| - "description":"lowercase endtags in RCDATA and RAWTEXT", |
138 |
| - "initialStates":["RCDATA state", "RAWTEXT state"], |
| 219 | + "description":"lowercase endtags", |
| 220 | + "initialStates":["RCDATA state", "RAWTEXT state", "Script data state"], |
139 | 221 | "lastStartTag":"xmp",
|
140 | 222 | "input":"</XMP>",
|
141 | 223 | "output":[["EndTag","xmp"]]
|
142 | 224 | },
|
143 | 225 | {
|
144 |
| - "description":"bad endtag in RCDATA and RAWTEXT", |
145 |
| - "initialStates":["RCDATA state", "RAWTEXT state"], |
| 226 | + "description":"bad endtag (space before name)", |
| 227 | + "initialStates":["RCDATA state", "RAWTEXT state", "Script data state"], |
146 | 228 | "lastStartTag":"xmp",
|
147 | 229 | "input":"</ XMP>",
|
148 | 230 | "output":[["Character","</ XMP>"]]
|
149 | 231 | },
|
150 | 232 | {
|
151 |
| - "description":"bad endtag in RCDATA and RAWTEXT", |
152 |
| - "initialStates":["RCDATA state", "RAWTEXT state"], |
| 233 | + "description":"bad endtag (not matching last start tag)", |
| 234 | + "initialStates":["RCDATA state", "RAWTEXT state", "Script data state"], |
153 | 235 | "lastStartTag":"xmp",
|
154 | 236 | "input":"</xm>",
|
155 | 237 | "output":[["Character","</xm>"]]
|
156 | 238 | },
|
157 | 239 | {
|
158 |
| - "description":"bad endtag in RCDATA and RAWTEXT", |
159 |
| - "initialStates":["RCDATA state", "RAWTEXT state"], |
| 240 | + "description":"bad endtag (without close bracket)", |
| 241 | + "initialStates":["RCDATA state", "RAWTEXT state", "Script data state"], |
160 | 242 | "lastStartTag":"xmp",
|
161 | 243 | "input":"</xm ",
|
162 | 244 | "output":[["Character","</xm "]]
|
163 | 245 | },
|
164 | 246 | {
|
165 |
| - "description":"bad endtag in RCDATA and RAWTEXT", |
166 |
| - "initialStates":["RCDATA state", "RAWTEXT state"], |
| 247 | + "description":"bad endtag (trailing solidus)", |
| 248 | + "initialStates":["RCDATA state", "RAWTEXT state", "Script data state"], |
167 | 249 | "lastStartTag":"xmp",
|
168 | 250 | "input":"</xm/",
|
169 | 251 | "output":[["Character","</xm/"]]
|
|
200 | 282 | },
|
201 | 283 | {
|
202 | 284 | "description":"CDATA content",
|
203 |
| - "input":"foo&bar", |
| 285 | + "input":"foo ]]>", |
| 286 | + "initialStates":["CDATA section state"], |
| 287 | + "output":[["Character", "foo "]] |
| 288 | + }, |
| 289 | + { |
| 290 | + "description":"CDATA followed by HTML content", |
| 291 | + "input":"foo ]]> ", |
| 292 | + "initialStates":["CDATA section state"], |
| 293 | + "output":[["Character", "foo  "]] |
| 294 | + }, |
| 295 | + { |
| 296 | + "description":"CDATA with extra bracket", |
| 297 | + "input":"foo]]]>", |
| 298 | + "initialStates":["CDATA section state"], |
| 299 | + "output":[["Character", "foo]"]] |
| 300 | + }, |
| 301 | + { |
| 302 | + "description":"CDATA without end marker", |
| 303 | + "input":"foo", |
| 304 | + "initialStates":["CDATA section state"], |
| 305 | + "output":[["Character", "foo"]], |
| 306 | + "errors":[ |
| 307 | + { "code": "eof-in-cdata", "line": 1, "col": 4 } |
| 308 | + ] |
| 309 | + }, |
| 310 | + { |
| 311 | + "description":"CDATA with single bracket ending", |
| 312 | + "input":"foo]", |
| 313 | + "initialStates":["CDATA section state"], |
| 314 | + "output":[["Character", "foo]"]], |
| 315 | + "errors":[ |
| 316 | + { "code": "eof-in-cdata", "line": 1, "col": 5 } |
| 317 | + ] |
| 318 | + }, |
| 319 | + { |
| 320 | + "description":"CDATA with two brackets ending", |
| 321 | + "input":"foo]]", |
204 | 322 | "initialStates":["CDATA section state"],
|
205 |
| - "output":[["Character", "foo&bar"]], |
| 323 | + "output":[["Character", "foo]]"]], |
206 | 324 | "errors":[
|
207 |
| - { "code": "eof-in-cdata", "line": 1, "col": 8 } |
| 325 | + { "code": "eof-in-cdata", "line": 1, "col": 6 } |
208 | 326 | ]
|
209 | 327 | }
|
210 | 328 |
|
|
0 commit comments