1{ 2 "tests": [ 3 { 4 "fragmentContext": null, 5 "description": "FOO<script>'Hello'</script>BAR", 6 "input": "FOO<script>'Hello'</script>BAR", 7 "output": [ 8 [ 9 "Character", 10 "FOO" 11 ], 12 [ 13 "StartTag", 14 "script", 15 {} 16 ], 17 [ 18 "Character", 19 "'Hello'" 20 ], 21 [ 22 "EndTag", 23 "script" 24 ], 25 [ 26 "Character", 27 "BAR" 28 ] 29 ] 30 }, 31 { 32 "fragmentContext": null, 33 "description": "FOO<script></script>BAR", 34 "input": "FOO<script></script>BAR", 35 "output": [ 36 [ 37 "Character", 38 "FOO" 39 ], 40 [ 41 "StartTag", 42 "script", 43 {} 44 ], 45 [ 46 "EndTag", 47 "script" 48 ], 49 [ 50 "Character", 51 "BAR" 52 ] 53 ] 54 }, 55 { 56 "fragmentContext": null, 57 "description": "FOO<script></script >BAR", 58 "input": "FOO<script></script >BAR", 59 "output": [ 60 [ 61 "Character", 62 "FOO" 63 ], 64 [ 65 "StartTag", 66 "script", 67 {} 68 ], 69 [ 70 "EndTag", 71 "script" 72 ], 73 [ 74 "Character", 75 "BAR" 76 ] 77 ] 78 }, 79 { 80 "fragmentContext": null, 81 "description": "FOO<script></script/>BAR", 82 "input": "FOO<script></script/>BAR", 83 "output": [ 84 [ 85 "Character", 86 "FOO" 87 ], 88 [ 89 "StartTag", 90 "script", 91 {} 92 ], 93 [ 94 "EndTag", 95 "script" 96 ], 97 [ 98 "Character", 99 "BAR" 100 ] 101 ] 102 }, 103 { 104 "fragmentContext": null, 105 "description": "FOO<script></script/ >BAR", 106 "input": "FOO<script></script/ >BAR", 107 "output": [ 108 [ 109 "Character", 110 "FOO" 111 ], 112 [ 113 "StartTag", 114 "script", 115 {} 116 ], 117 [ 118 "EndTag", 119 "script" 120 ], 121 [ 122 "Character", 123 "BAR" 124 ] 125 ] 126 }, 127 { 128 "fragmentContext": null, 129 "description": "FOO<script type=\"text/plain\"></scriptx>BAR", 130 "input": "FOO<script type=\"text/plain\"></scriptx>BAR", 131 "output": [ 132 [ 133 "Character", 134 "FOO" 135 ], 136 [ 137 "StartTag", 138 "script", 139 { 140 "type": "text/plain" 141 } 142 ], 143 [ 144 "Character", 145 "</scriptx>BAR" 146 ] 147 ] 148 }, 149 { 150 "fragmentContext": null, 151 "description": "FOO<script></script foo=\">\" dd>BAR", 152 "input": "FOO<script></script foo=\">\" dd>BAR", 153 "output": [ 154 [ 155 "Character", 156 "FOO" 157 ], 158 [ 159 "StartTag", 160 "script", 161 {} 162 ], 163 [ 164 "EndTag", 165 "script" 166 ], 167 [ 168 "Character", 169 "BAR" 170 ] 171 ] 172 }, 173 { 174 "fragmentContext": null, 175 "description": "FOO<script>'<'</script>BAR", 176 "input": "FOO<script>'<'</script>BAR", 177 "output": [ 178 [ 179 "Character", 180 "FOO" 181 ], 182 [ 183 "StartTag", 184 "script", 185 {} 186 ], 187 [ 188 "Character", 189 "'<'" 190 ], 191 [ 192 "EndTag", 193 "script" 194 ], 195 [ 196 "Character", 197 "BAR" 198 ] 199 ] 200 }, 201 { 202 "fragmentContext": null, 203 "description": "FOO<script>'<!'</script>BAR", 204 "input": "FOO<script>'<!'</script>BAR", 205 "output": [ 206 [ 207 "Character", 208 "FOO" 209 ], 210 [ 211 "StartTag", 212 "script", 213 {} 214 ], 215 [ 216 "Character", 217 "'<!'" 218 ], 219 [ 220 "EndTag", 221 "script" 222 ], 223 [ 224 "Character", 225 "BAR" 226 ] 227 ] 228 }, 229 { 230 "fragmentContext": null, 231 "description": "FOO<script>'<!-'</script>BAR", 232 "input": "FOO<script>'<!-'</script>BAR", 233 "output": [ 234 [ 235 "Character", 236 "FOO" 237 ], 238 [ 239 "StartTag", 240 "script", 241 {} 242 ], 243 [ 244 "Character", 245 "'<!-'" 246 ], 247 [ 248 "EndTag", 249 "script" 250 ], 251 [ 252 "Character", 253 "BAR" 254 ] 255 ] 256 }, 257 { 258 "fragmentContext": null, 259 "description": "FOO<script>'<!--'</script>BAR", 260 "input": "FOO<script>'<!--'</script>BAR", 261 "output": [ 262 [ 263 "Character", 264 "FOO" 265 ], 266 [ 267 "StartTag", 268 "script", 269 {} 270 ], 271 [ 272 "Character", 273 "'<!--'" 274 ], 275 [ 276 "EndTag", 277 "script" 278 ], 279 [ 280 "Character", 281 "BAR" 282 ] 283 ] 284 }, 285 { 286 "fragmentContext": null, 287 "description": "FOO<script>'<!---'</script>BAR", 288 "input": "FOO<script>'<!---'</script>BAR", 289 "output": [ 290 [ 291 "Character", 292 "FOO" 293 ], 294 [ 295 "StartTag", 296 "script", 297 {} 298 ], 299 [ 300 "Character", 301 "'<!---'" 302 ], 303 [ 304 "EndTag", 305 "script" 306 ], 307 [ 308 "Character", 309 "BAR" 310 ] 311 ] 312 }, 313 { 314 "fragmentContext": null, 315 "description": "FOO<script>'<!-->'</script>BAR", 316 "input": "FOO<script>'<!-->'</script>BAR", 317 "output": [ 318 [ 319 "Character", 320 "FOO" 321 ], 322 [ 323 "StartTag", 324 "script", 325 {} 326 ], 327 [ 328 "Character", 329 "'<!-->'" 330 ], 331 [ 332 "EndTag", 333 "script" 334 ], 335 [ 336 "Character", 337 "BAR" 338 ] 339 ] 340 }, 341 { 342 "fragmentContext": null, 343 "description": "FOO<script>'<!-->'</script>BAR", 344 "input": "FOO<script>'<!-->'</script>BAR", 345 "output": [ 346 [ 347 "Character", 348 "FOO" 349 ], 350 [ 351 "StartTag", 352 "script", 353 {} 354 ], 355 [ 356 "Character", 357 "'<!-->'" 358 ], 359 [ 360 "EndTag", 361 "script" 362 ], 363 [ 364 "Character", 365 "BAR" 366 ] 367 ] 368 }, 369 { 370 "fragmentContext": null, 371 "description": "FOO<script>'<!-- potato'</script>BAR", 372 "input": "FOO<script>'<!-- potato'</script>BAR", 373 "output": [ 374 [ 375 "Character", 376 "FOO" 377 ], 378 [ 379 "StartTag", 380 "script", 381 {} 382 ], 383 [ 384 "Character", 385 "'<!-- potato'" 386 ], 387 [ 388 "EndTag", 389 "script" 390 ], 391 [ 392 "Character", 393 "BAR" 394 ] 395 ] 396 }, 397 { 398 "fragmentContext": null, 399 "description": "FOO<script>'<!-- <sCrIpt'</script>BAR", 400 "input": "FOO<script>'<!-- <sCrIpt'</script>BAR", 401 "output": [ 402 [ 403 "Character", 404 "FOO" 405 ], 406 [ 407 "StartTag", 408 "script", 409 {} 410 ], 411 [ 412 "Character", 413 "'<!-- <sCrIpt'" 414 ], 415 [ 416 "EndTag", 417 "script" 418 ], 419 [ 420 "Character", 421 "BAR" 422 ] 423 ] 424 }, 425 { 426 "fragmentContext": null, 427 "description": "FOO<script type=\"text/plain\">'<!-- <sCrIpt>'</script>BAR", 428 "input": "FOO<script type=\"text/plain\">'<!-- <sCrIpt>'</script>BAR", 429 "output": [ 430 [ 431 "Character", 432 "FOO" 433 ], 434 [ 435 "StartTag", 436 "script", 437 { 438 "type": "text/plain" 439 } 440 ], 441 [ 442 "Character", 443 "'<!-- <sCrIpt>'</script>BAR" 444 ] 445 ] 446 }, 447 { 448 "fragmentContext": null, 449 "description": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -'</script>BAR", 450 "input": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -'</script>BAR", 451 "output": [ 452 [ 453 "Character", 454 "FOO" 455 ], 456 [ 457 "StartTag", 458 "script", 459 { 460 "type": "text/plain" 461 } 462 ], 463 [ 464 "Character", 465 "'<!-- <sCrIpt> -'</script>BAR" 466 ] 467 ] 468 }, 469 { 470 "fragmentContext": null, 471 "description": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --'</script>BAR", 472 "input": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --'</script>BAR", 473 "output": [ 474 [ 475 "Character", 476 "FOO" 477 ], 478 [ 479 "StartTag", 480 "script", 481 { 482 "type": "text/plain" 483 } 484 ], 485 [ 486 "Character", 487 "'<!-- <sCrIpt> --'</script>BAR" 488 ] 489 ] 490 }, 491 { 492 "fragmentContext": null, 493 "description": "FOO<script>'<!-- <sCrIpt> -->'</script>BAR", 494 "input": "FOO<script>'<!-- <sCrIpt> -->'</script>BAR", 495 "output": [ 496 [ 497 "Character", 498 "FOO" 499 ], 500 [ 501 "StartTag", 502 "script", 503 {} 504 ], 505 [ 506 "Character", 507 "'<!-- <sCrIpt> -->'" 508 ], 509 [ 510 "EndTag", 511 "script" 512 ], 513 [ 514 "Character", 515 "BAR" 516 ] 517 ] 518 }, 519 { 520 "fragmentContext": null, 521 "description": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --!>'</script>BAR", 522 "input": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --!>'</script>BAR", 523 "output": [ 524 [ 525 "Character", 526 "FOO" 527 ], 528 [ 529 "StartTag", 530 "script", 531 { 532 "type": "text/plain" 533 } 534 ], 535 [ 536 "Character", 537 "'<!-- <sCrIpt> --!>'</script>BAR" 538 ] 539 ] 540 }, 541 { 542 "fragmentContext": null, 543 "description": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -- >'</script>BAR", 544 "input": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -- >'</script>BAR", 545 "output": [ 546 [ 547 "Character", 548 "FOO" 549 ], 550 [ 551 "StartTag", 552 "script", 553 { 554 "type": "text/plain" 555 } 556 ], 557 [ 558 "Character", 559 "'<!-- <sCrIpt> -- >'</script>BAR" 560 ] 561 ] 562 }, 563 { 564 "fragmentContext": null, 565 "description": "FOO<script type=\"text/plain\">'<!-- <sCrIpt '</script>BAR", 566 "input": "FOO<script type=\"text/plain\">'<!-- <sCrIpt '</script>BAR", 567 "output": [ 568 [ 569 "Character", 570 "FOO" 571 ], 572 [ 573 "StartTag", 574 "script", 575 { 576 "type": "text/plain" 577 } 578 ], 579 [ 580 "Character", 581 "'<!-- <sCrIpt '</script>BAR" 582 ] 583 ] 584 }, 585 { 586 "fragmentContext": null, 587 "description": "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR", 588 "input": "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR", 589 "output": [ 590 [ 591 "Character", 592 "FOO" 593 ], 594 [ 595 "StartTag", 596 "script", 597 { 598 "type": "text/plain" 599 } 600 ], 601 [ 602 "Character", 603 "'<!-- <sCrIpt/'</script>BAR" 604 ] 605 ] 606 }, 607 { 608 "fragmentContext": null, 609 "description": "FOO<script type=\"text/plain\">'<!-- <sCrIpt\\'</script>BAR", 610 "input": "FOO<script type=\"text/plain\">'<!-- <sCrIpt\\'</script>BAR", 611 "output": [ 612 [ 613 "Character", 614 "FOO" 615 ], 616 [ 617 "StartTag", 618 "script", 619 { 620 "type": "text/plain" 621 } 622 ], 623 [ 624 "Character", 625 "'<!-- <sCrIpt\\'" 626 ], 627 [ 628 "EndTag", 629 "script" 630 ], 631 [ 632 "Character", 633 "BAR" 634 ] 635 ] 636 }, 637 { 638 "fragmentContext": null, 639 "description": "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>QUX", 640 "input": "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>QUX", 641 "output": [ 642 [ 643 "Character", 644 "FOO" 645 ], 646 [ 647 "StartTag", 648 "script", 649 { 650 "type": "text/plain" 651 } 652 ], 653 [ 654 "Character", 655 "'<!-- <sCrIpt/'</script>BAR" 656 ], 657 [ 658 "EndTag", 659 "script" 660 ], 661 [ 662 "Character", 663 "QUX" 664 ] 665 ] 666 }, 667 { 668 "fragmentContext": null, 669 "description": "FOO<script><!--<script>-></script>--></script>QUX", 670 "input": "FOO<script><!--<script>-></script>--></script>QUX", 671 "output": [ 672 [ 673 "Character", 674 "FOO" 675 ], 676 [ 677 "StartTag", 678 "script", 679 {} 680 ], 681 [ 682 "Character", 683 "<!--<script>-></script>-->" 684 ], 685 [ 686 "EndTag", 687 "script" 688 ], 689 [ 690 "Character", 691 "QUX" 692 ] 693 ] 694 } 695 ] 696}