1{ 2 "tests": [ 3 { 4 "description": "<div<div>", 5 "input": "<div<div>", 6 "output": [ 7 [ 8 "StartTag", 9 "div<div", 10 {} 11 ] 12 ] 13 }, 14 { 15 "description": "<div foo<bar=''>", 16 "input": "<div foo<bar=''>", 17 "output": [ 18 [ 19 "StartTag", 20 "div", 21 { 22 "foo<bar": "" 23 } 24 ] 25 ] 26 }, 27 { 28 "description": "<div foo=`bar`>", 29 "input": "<div foo=`bar`>", 30 "output": [ 31 [ 32 "StartTag", 33 "div", 34 { 35 "foo": "`bar`" 36 } 37 ] 38 ] 39 }, 40 { 41 "description": "<div \\\"foo=''>", 42 "input": "<div \\\"foo=''>", 43 "output": [ 44 [ 45 "StartTag", 46 "div", 47 { 48 "\\\"foo": "" 49 } 50 ] 51 ] 52 }, 53 { 54 "description": "<a href='\\nbar'></a>", 55 "input": "<a href='\\nbar'></a>", 56 "output": [ 57 [ 58 "StartTag", 59 "a", 60 { 61 "href": "\\nbar" 62 } 63 ], 64 [ 65 "EndTag", 66 "a" 67 ] 68 ] 69 }, 70 { 71 "description": "<!DOCTYPE html>", 72 "input": "<!DOCTYPE html>", 73 "output": [ 74 [ 75 "DOCTYPE", 76 "html", 77 null, 78 null, 79 true 80 ] 81 ] 82 }, 83 { 84 "description": "⟨⟩", 85 "input": "⟨⟩", 86 "output": [ 87 [ 88 "Character", 89 "⟨⟩" 90 ] 91 ] 92 }, 93 { 94 "description": "'", 95 "input": "'", 96 "output": [ 97 [ 98 "Character", 99 "'" 100 ] 101 ] 102 }, 103 { 104 "description": "ⅈ", 105 "input": "ⅈ", 106 "output": [ 107 [ 108 "Character", 109 "ⅈ" 110 ] 111 ] 112 }, 113 { 114 "description": "𝕂", 115 "input": "𝕂", 116 "output": [ 117 [ 118 "Character", 119 "" 120 ] 121 ] 122 }, 123 { 124 "description": "∉", 125 "input": "∉", 126 "output": [ 127 [ 128 "Character", 129 "∉" 130 ] 131 ] 132 }, 133 { 134 "description": "<?import namespace=\"foo\" implementation=\"#bar\">", 135 "input": "<?import namespace=\"foo\" implementation=\"#bar\">", 136 "output": [ 137 [ 138 "Comment", 139 "?import namespace=\"foo\" implementation=\"#bar\"" 140 ] 141 ] 142 }, 143 { 144 "description": "<!--foo--bar-->", 145 "input": "<!--foo--bar-->", 146 "output": [ 147 [ 148 "Comment", 149 "foo--bar" 150 ] 151 ] 152 }, 153 { 154 "description": "<![CDATA[x]]>", 155 "input": "<![CDATA[x]]>", 156 "output": [ 157 [ 158 "Comment", 159 "[CDATA[x]]" 160 ] 161 ] 162 }, 163 { 164 "description": "<textarea><!--</textarea>--></textarea>", 165 "input": "<textarea><!--</textarea>--></textarea>", 166 "output": [ 167 [ 168 "StartTag", 169 "textarea", 170 {} 171 ], 172 [ 173 "Character", 174 "<!--" 175 ], 176 [ 177 "EndTag", 178 "textarea" 179 ], 180 [ 181 "Character", 182 "-->" 183 ], 184 [ 185 "EndTag", 186 "textarea" 187 ] 188 ] 189 }, 190 { 191 "description": "<textarea><!--</textarea>-->", 192 "input": "<textarea><!--</textarea>-->", 193 "output": [ 194 [ 195 "StartTag", 196 "textarea", 197 {} 198 ], 199 [ 200 "Character", 201 "<!--" 202 ], 203 [ 204 "EndTag", 205 "textarea" 206 ], 207 [ 208 "Character", 209 "-->" 210 ] 211 ] 212 }, 213 { 214 "description": "<style><!--</style>--></style>", 215 "input": "<style><!--</style>--></style>", 216 "output": [ 217 [ 218 "StartTag", 219 "style", 220 {} 221 ], 222 [ 223 "Character", 224 "<!--" 225 ], 226 [ 227 "EndTag", 228 "style" 229 ], 230 [ 231 "Character", 232 "-->" 233 ], 234 [ 235 "EndTag", 236 "style" 237 ] 238 ] 239 }, 240 { 241 "description": "<style><!--</style>-->", 242 "input": "<style><!--</style>-->", 243 "output": [ 244 [ 245 "StartTag", 246 "style", 247 {} 248 ], 249 [ 250 "Character", 251 "<!--" 252 ], 253 [ 254 "EndTag", 255 "style" 256 ], 257 [ 258 "Character", 259 "-->" 260 ] 261 ] 262 }, 263 { 264 "description": "<ul><li>A </li> <li>B</li></ul>", 265 "input": "<ul><li>A </li> <li>B</li></ul>", 266 "output": [ 267 [ 268 "StartTag", 269 "ul", 270 {} 271 ], 272 [ 273 "StartTag", 274 "li", 275 {} 276 ], 277 [ 278 "Character", 279 "A " 280 ], 281 [ 282 "EndTag", 283 "li" 284 ], 285 [ 286 "Character", 287 " " 288 ], 289 [ 290 "StartTag", 291 "li", 292 {} 293 ], 294 [ 295 "Character", 296 "B" 297 ], 298 [ 299 "EndTag", 300 "li" 301 ], 302 [ 303 "EndTag", 304 "ul" 305 ] 306 ] 307 }, 308 { 309 "description": "<table><form><input type=hidden><input></form><div></div></table>", 310 "input": "<table><form><input type=hidden><input></form><div></div></table>", 311 "output": [ 312 [ 313 "StartTag", 314 "table", 315 {} 316 ], 317 [ 318 "StartTag", 319 "form", 320 {} 321 ], 322 [ 323 "StartTag", 324 "input", 325 { 326 "type": "hidden" 327 } 328 ], 329 [ 330 "StartTag", 331 "input", 332 {} 333 ], 334 [ 335 "EndTag", 336 "form" 337 ], 338 [ 339 "StartTag", 340 "div", 341 {} 342 ], 343 [ 344 "EndTag", 345 "div" 346 ], 347 [ 348 "EndTag", 349 "table" 350 ] 351 ] 352 }, 353 { 354 "description": "<i>A<b>B<p></i>C</b>D", 355 "input": "<i>A<b>B<p></i>C</b>D", 356 "output": [ 357 [ 358 "StartTag", 359 "i", 360 {} 361 ], 362 [ 363 "Character", 364 "A" 365 ], 366 [ 367 "StartTag", 368 "b", 369 {} 370 ], 371 [ 372 "Character", 373 "B" 374 ], 375 [ 376 "StartTag", 377 "p", 378 {} 379 ], 380 [ 381 "EndTag", 382 "i" 383 ], 384 [ 385 "Character", 386 "C" 387 ], 388 [ 389 "EndTag", 390 "b" 391 ], 392 [ 393 "Character", 394 "D" 395 ] 396 ] 397 }, 398 { 399 "description": "<div></div>", 400 "input": "<div></div>", 401 "output": [ 402 [ 403 "StartTag", 404 "div", 405 {} 406 ], 407 [ 408 "EndTag", 409 "div" 410 ] 411 ] 412 }, 413 { 414 "description": "<svg></svg>", 415 "input": "<svg></svg>", 416 "output": [ 417 [ 418 "StartTag", 419 "svg", 420 {} 421 ], 422 [ 423 "EndTag", 424 "svg" 425 ] 426 ] 427 }, 428 { 429 "description": "<math></math>", 430 "input": "<math></math>", 431 "output": [ 432 [ 433 "StartTag", 434 "math", 435 {} 436 ], 437 [ 438 "EndTag", 439 "math" 440 ] 441 ] 442 } 443 ] 444}