1{ 2 "tests": [ 3 { 4 "description": "<!doctype html><p><button><button>", 5 "input": "<!doctype html><p><button><button>", 6 "output": [ 7 [ 8 "DOCTYPE", 9 "html", 10 null, 11 null, 12 true 13 ], 14 [ 15 "StartTag", 16 "p", 17 {} 18 ], 19 [ 20 "StartTag", 21 "button", 22 {} 23 ], 24 [ 25 "StartTag", 26 "button", 27 {} 28 ] 29 ] 30 }, 31 { 32 "description": "<!doctype html><p><button><address>", 33 "input": "<!doctype html><p><button><address>", 34 "output": [ 35 [ 36 "DOCTYPE", 37 "html", 38 null, 39 null, 40 true 41 ], 42 [ 43 "StartTag", 44 "p", 45 {} 46 ], 47 [ 48 "StartTag", 49 "button", 50 {} 51 ], 52 [ 53 "StartTag", 54 "address", 55 {} 56 ] 57 ] 58 }, 59 { 60 "description": "<!doctype html><p><button><blockquote>", 61 "input": "<!doctype html><p><button><blockquote>", 62 "output": [ 63 [ 64 "DOCTYPE", 65 "html", 66 null, 67 null, 68 true 69 ], 70 [ 71 "StartTag", 72 "p", 73 {} 74 ], 75 [ 76 "StartTag", 77 "button", 78 {} 79 ], 80 [ 81 "StartTag", 82 "blockquote", 83 {} 84 ] 85 ] 86 }, 87 { 88 "description": "<!doctype html><p><button><menu>", 89 "input": "<!doctype html><p><button><menu>", 90 "output": [ 91 [ 92 "DOCTYPE", 93 "html", 94 null, 95 null, 96 true 97 ], 98 [ 99 "StartTag", 100 "p", 101 {} 102 ], 103 [ 104 "StartTag", 105 "button", 106 {} 107 ], 108 [ 109 "StartTag", 110 "menu", 111 {} 112 ] 113 ] 114 }, 115 { 116 "description": "<!doctype html><p><button><p>", 117 "input": "<!doctype html><p><button><p>", 118 "output": [ 119 [ 120 "DOCTYPE", 121 "html", 122 null, 123 null, 124 true 125 ], 126 [ 127 "StartTag", 128 "p", 129 {} 130 ], 131 [ 132 "StartTag", 133 "button", 134 {} 135 ], 136 [ 137 "StartTag", 138 "p", 139 {} 140 ] 141 ] 142 }, 143 { 144 "description": "<!doctype html><p><button><ul>", 145 "input": "<!doctype html><p><button><ul>", 146 "output": [ 147 [ 148 "DOCTYPE", 149 "html", 150 null, 151 null, 152 true 153 ], 154 [ 155 "StartTag", 156 "p", 157 {} 158 ], 159 [ 160 "StartTag", 161 "button", 162 {} 163 ], 164 [ 165 "StartTag", 166 "ul", 167 {} 168 ] 169 ] 170 }, 171 { 172 "description": "<!doctype html><p><button><h1>", 173 "input": "<!doctype html><p><button><h1>", 174 "output": [ 175 [ 176 "DOCTYPE", 177 "html", 178 null, 179 null, 180 true 181 ], 182 [ 183 "StartTag", 184 "p", 185 {} 186 ], 187 [ 188 "StartTag", 189 "button", 190 {} 191 ], 192 [ 193 "StartTag", 194 "h1", 195 {} 196 ] 197 ] 198 }, 199 { 200 "description": "<!doctype html><p><button><h6>", 201 "input": "<!doctype html><p><button><h6>", 202 "output": [ 203 [ 204 "DOCTYPE", 205 "html", 206 null, 207 null, 208 true 209 ], 210 [ 211 "StartTag", 212 "p", 213 {} 214 ], 215 [ 216 "StartTag", 217 "button", 218 {} 219 ], 220 [ 221 "StartTag", 222 "h6", 223 {} 224 ] 225 ] 226 }, 227 { 228 "description": "<!doctype html><p><button><listing>", 229 "input": "<!doctype html><p><button><listing>", 230 "output": [ 231 [ 232 "DOCTYPE", 233 "html", 234 null, 235 null, 236 true 237 ], 238 [ 239 "StartTag", 240 "p", 241 {} 242 ], 243 [ 244 "StartTag", 245 "button", 246 {} 247 ], 248 [ 249 "StartTag", 250 "listing", 251 {} 252 ] 253 ] 254 }, 255 { 256 "description": "<!doctype html><p><button><pre>", 257 "input": "<!doctype html><p><button><pre>", 258 "output": [ 259 [ 260 "DOCTYPE", 261 "html", 262 null, 263 null, 264 true 265 ], 266 [ 267 "StartTag", 268 "p", 269 {} 270 ], 271 [ 272 "StartTag", 273 "button", 274 {} 275 ], 276 [ 277 "StartTag", 278 "pre", 279 {} 280 ] 281 ] 282 }, 283 { 284 "description": "<!doctype html><p><button><form>", 285 "input": "<!doctype html><p><button><form>", 286 "output": [ 287 [ 288 "DOCTYPE", 289 "html", 290 null, 291 null, 292 true 293 ], 294 [ 295 "StartTag", 296 "p", 297 {} 298 ], 299 [ 300 "StartTag", 301 "button", 302 {} 303 ], 304 [ 305 "StartTag", 306 "form", 307 {} 308 ] 309 ] 310 }, 311 { 312 "description": "<!doctype html><p><button><li>", 313 "input": "<!doctype html><p><button><li>", 314 "output": [ 315 [ 316 "DOCTYPE", 317 "html", 318 null, 319 null, 320 true 321 ], 322 [ 323 "StartTag", 324 "p", 325 {} 326 ], 327 [ 328 "StartTag", 329 "button", 330 {} 331 ], 332 [ 333 "StartTag", 334 "li", 335 {} 336 ] 337 ] 338 }, 339 { 340 "description": "<!doctype html><p><button><dd>", 341 "input": "<!doctype html><p><button><dd>", 342 "output": [ 343 [ 344 "DOCTYPE", 345 "html", 346 null, 347 null, 348 true 349 ], 350 [ 351 "StartTag", 352 "p", 353 {} 354 ], 355 [ 356 "StartTag", 357 "button", 358 {} 359 ], 360 [ 361 "StartTag", 362 "dd", 363 {} 364 ] 365 ] 366 }, 367 { 368 "description": "<!doctype html><p><button><dt>", 369 "input": "<!doctype html><p><button><dt>", 370 "output": [ 371 [ 372 "DOCTYPE", 373 "html", 374 null, 375 null, 376 true 377 ], 378 [ 379 "StartTag", 380 "p", 381 {} 382 ], 383 [ 384 "StartTag", 385 "button", 386 {} 387 ], 388 [ 389 "StartTag", 390 "dt", 391 {} 392 ] 393 ] 394 }, 395 { 396 "description": "<!doctype html><p><button><plaintext>", 397 "input": "<!doctype html><p><button><plaintext>", 398 "output": [ 399 [ 400 "DOCTYPE", 401 "html", 402 null, 403 null, 404 true 405 ], 406 [ 407 "StartTag", 408 "p", 409 {} 410 ], 411 [ 412 "StartTag", 413 "button", 414 {} 415 ], 416 [ 417 "StartTag", 418 "plaintext", 419 {} 420 ] 421 ] 422 }, 423 { 424 "description": "<!doctype html><p><button><table>", 425 "input": "<!doctype html><p><button><table>", 426 "output": [ 427 [ 428 "DOCTYPE", 429 "html", 430 null, 431 null, 432 true 433 ], 434 [ 435 "StartTag", 436 "p", 437 {} 438 ], 439 [ 440 "StartTag", 441 "button", 442 {} 443 ], 444 [ 445 "StartTag", 446 "table", 447 {} 448 ] 449 ] 450 }, 451 { 452 "description": "<!doctype html><p><button><hr>", 453 "input": "<!doctype html><p><button><hr>", 454 "output": [ 455 [ 456 "DOCTYPE", 457 "html", 458 null, 459 null, 460 true 461 ], 462 [ 463 "StartTag", 464 "p", 465 {} 466 ], 467 [ 468 "StartTag", 469 "button", 470 {} 471 ], 472 [ 473 "StartTag", 474 "hr", 475 {} 476 ] 477 ] 478 }, 479 { 480 "description": "<!doctype html><p><button><xmp>", 481 "input": "<!doctype html><p><button><xmp>", 482 "output": [ 483 [ 484 "DOCTYPE", 485 "html", 486 null, 487 null, 488 true 489 ], 490 [ 491 "StartTag", 492 "p", 493 {} 494 ], 495 [ 496 "StartTag", 497 "button", 498 {} 499 ], 500 [ 501 "StartTag", 502 "xmp", 503 {} 504 ] 505 ] 506 }, 507 { 508 "description": "<!doctype html><p><button></p>", 509 "input": "<!doctype html><p><button></p>", 510 "output": [ 511 [ 512 "DOCTYPE", 513 "html", 514 null, 515 null, 516 true 517 ], 518 [ 519 "StartTag", 520 "p", 521 {} 522 ], 523 [ 524 "StartTag", 525 "button", 526 {} 527 ], 528 [ 529 "EndTag", 530 "p" 531 ] 532 ] 533 }, 534 { 535 "description": "<!doctype html><address><button></address>a", 536 "input": "<!doctype html><address><button></address>a", 537 "output": [ 538 [ 539 "DOCTYPE", 540 "html", 541 null, 542 null, 543 true 544 ], 545 [ 546 "StartTag", 547 "address", 548 {} 549 ], 550 [ 551 "StartTag", 552 "button", 553 {} 554 ], 555 [ 556 "EndTag", 557 "address" 558 ], 559 [ 560 "Character", 561 "a" 562 ] 563 ] 564 }, 565 { 566 "description": "<!doctype html><address><button></address>a", 567 "input": "<!doctype html><address><button></address>a", 568 "output": [ 569 [ 570 "DOCTYPE", 571 "html", 572 null, 573 null, 574 true 575 ], 576 [ 577 "StartTag", 578 "address", 579 {} 580 ], 581 [ 582 "StartTag", 583 "button", 584 {} 585 ], 586 [ 587 "EndTag", 588 "address" 589 ], 590 [ 591 "Character", 592 "a" 593 ] 594 ] 595 }, 596 { 597 "description": "<p><table></p>", 598 "input": "<p><table></p>", 599 "output": [ 600 [ 601 "StartTag", 602 "p", 603 {} 604 ], 605 [ 606 "StartTag", 607 "table", 608 {} 609 ], 610 [ 611 "EndTag", 612 "p" 613 ] 614 ] 615 }, 616 { 617 "description": "<!doctype html><svg>", 618 "input": "<!doctype html><svg>", 619 "output": [ 620 [ 621 "DOCTYPE", 622 "html", 623 null, 624 null, 625 true 626 ], 627 [ 628 "StartTag", 629 "svg", 630 {} 631 ] 632 ] 633 }, 634 { 635 "description": "<!doctype html><p><figcaption>", 636 "input": "<!doctype html><p><figcaption>", 637 "output": [ 638 [ 639 "DOCTYPE", 640 "html", 641 null, 642 null, 643 true 644 ], 645 [ 646 "StartTag", 647 "p", 648 {} 649 ], 650 [ 651 "StartTag", 652 "figcaption", 653 {} 654 ] 655 ] 656 }, 657 { 658 "description": "<!doctype html><p><summary>", 659 "input": "<!doctype html><p><summary>", 660 "output": [ 661 [ 662 "DOCTYPE", 663 "html", 664 null, 665 null, 666 true 667 ], 668 [ 669 "StartTag", 670 "p", 671 {} 672 ], 673 [ 674 "StartTag", 675 "summary", 676 {} 677 ] 678 ] 679 }, 680 { 681 "description": "<!doctype html><form><table><form>", 682 "input": "<!doctype html><form><table><form>", 683 "output": [ 684 [ 685 "DOCTYPE", 686 "html", 687 null, 688 null, 689 true 690 ], 691 [ 692 "StartTag", 693 "form", 694 {} 695 ], 696 [ 697 "StartTag", 698 "table", 699 {} 700 ], 701 [ 702 "StartTag", 703 "form", 704 {} 705 ] 706 ] 707 }, 708 { 709 "description": "<!doctype html><table><form><form>", 710 "input": "<!doctype html><table><form><form>", 711 "output": [ 712 [ 713 "DOCTYPE", 714 "html", 715 null, 716 null, 717 true 718 ], 719 [ 720 "StartTag", 721 "table", 722 {} 723 ], 724 [ 725 "StartTag", 726 "form", 727 {} 728 ], 729 [ 730 "StartTag", 731 "form", 732 {} 733 ] 734 ] 735 }, 736 { 737 "description": "<!doctype html><table><form></table><form>", 738 "input": "<!doctype html><table><form></table><form>", 739 "output": [ 740 [ 741 "DOCTYPE", 742 "html", 743 null, 744 null, 745 true 746 ], 747 [ 748 "StartTag", 749 "table", 750 {} 751 ], 752 [ 753 "StartTag", 754 "form", 755 {} 756 ], 757 [ 758 "EndTag", 759 "table" 760 ], 761 [ 762 "StartTag", 763 "form", 764 {} 765 ] 766 ] 767 }, 768 { 769 "description": "<!doctype html><svg><foreignObject><p>", 770 "input": "<!doctype html><svg><foreignObject><p>", 771 "output": [ 772 [ 773 "DOCTYPE", 774 "html", 775 null, 776 null, 777 true 778 ], 779 [ 780 "StartTag", 781 "svg", 782 {} 783 ], 784 [ 785 "StartTag", 786 "foreignObject", 787 {} 788 ], 789 [ 790 "StartTag", 791 "p", 792 {} 793 ] 794 ] 795 }, 796 { 797 "description": "<!doctype html><svg><title>abc", 798 "input": "<!doctype html><svg><title>abc", 799 "output": [ 800 [ 801 "DOCTYPE", 802 "html", 803 null, 804 null, 805 true 806 ], 807 [ 808 "StartTag", 809 "svg", 810 {} 811 ], 812 [ 813 "StartTag", 814 "title", 815 {} 816 ], 817 [ 818 "Character", 819 "abc" 820 ] 821 ] 822 }, 823 { 824 "description": "<option><span><option>", 825 "input": "<option><span><option>", 826 "output": [ 827 [ 828 "StartTag", 829 "option", 830 {} 831 ], 832 [ 833 "StartTag", 834 "span", 835 {} 836 ], 837 [ 838 "StartTag", 839 "option", 840 {} 841 ] 842 ] 843 }, 844 { 845 "description": "<option><option>", 846 "input": "<option><option>", 847 "output": [ 848 [ 849 "StartTag", 850 "option", 851 {} 852 ], 853 [ 854 "StartTag", 855 "option", 856 {} 857 ] 858 ] 859 }, 860 { 861 "description": "<math><annotation-xml><div>", 862 "input": "<math><annotation-xml><div>", 863 "output": [ 864 [ 865 "StartTag", 866 "math", 867 {} 868 ], 869 [ 870 "StartTag", 871 "annotation-xml", 872 {} 873 ], 874 [ 875 "StartTag", 876 "div", 877 {} 878 ] 879 ] 880 }, 881 { 882 "description": "<math><annotation-xml encoding=\"application/svg+xml\"><div>", 883 "input": "<math><annotation-xml encoding=\"application/svg+xml\"><div>", 884 "output": [ 885 [ 886 "StartTag", 887 "math", 888 {} 889 ], 890 [ 891 "StartTag", 892 "annotation-xml", 893 { 894 "encoding": "application/svg+xml" 895 } 896 ], 897 [ 898 "StartTag", 899 "div", 900 {} 901 ] 902 ] 903 }, 904 { 905 "description": "<math><annotation-xml encoding=\"application/xhtml+xml\"><div>", 906 "input": "<math><annotation-xml encoding=\"application/xhtml+xml\"><div>", 907 "output": [ 908 [ 909 "StartTag", 910 "math", 911 {} 912 ], 913 [ 914 "StartTag", 915 "annotation-xml", 916 { 917 "encoding": "application/xhtml+xml" 918 } 919 ], 920 [ 921 "StartTag", 922 "div", 923 {} 924 ] 925 ] 926 }, 927 { 928 "description": "<math><annotation-xml encoding=\"aPPlication/xhtmL+xMl\"><div>", 929 "input": "<math><annotation-xml encoding=\"aPPlication/xhtmL+xMl\"><div>", 930 "output": [ 931 [ 932 "StartTag", 933 "math", 934 {} 935 ], 936 [ 937 "StartTag", 938 "annotation-xml", 939 { 940 "encoding": "aPPlication/xhtmL+xMl" 941 } 942 ], 943 [ 944 "StartTag", 945 "div", 946 {} 947 ] 948 ] 949 }, 950 { 951 "description": "<math><annotation-xml encoding=\"text/html\"><div>", 952 "input": "<math><annotation-xml encoding=\"text/html\"><div>", 953 "output": [ 954 [ 955 "StartTag", 956 "math", 957 {} 958 ], 959 [ 960 "StartTag", 961 "annotation-xml", 962 { 963 "encoding": "text/html" 964 } 965 ], 966 [ 967 "StartTag", 968 "div", 969 {} 970 ] 971 ] 972 }, 973 { 974 "description": "<math><annotation-xml encoding=\"Text/htmL\"><div>", 975 "input": "<math><annotation-xml encoding=\"Text/htmL\"><div>", 976 "output": [ 977 [ 978 "StartTag", 979 "math", 980 {} 981 ], 982 [ 983 "StartTag", 984 "annotation-xml", 985 { 986 "encoding": "Text/htmL" 987 } 988 ], 989 [ 990 "StartTag", 991 "div", 992 {} 993 ] 994 ] 995 }, 996 { 997 "description": "<math><annotation-xml encoding=\" text/html \"><div>", 998 "input": "<math><annotation-xml encoding=\" text/html \"><div>", 999 "output": [ 1000 [ 1001 "StartTag", 1002 "math", 1003 {} 1004 ], 1005 [ 1006 "StartTag", 1007 "annotation-xml", 1008 { 1009 "encoding": " text/html " 1010 } 1011 ], 1012 [ 1013 "StartTag", 1014 "div", 1015 {} 1016 ] 1017 ] 1018 }, 1019 { 1020 "description": "<math><annotation-xml> </annotation-xml>", 1021 "input": "<math><annotation-xml> </annotation-xml>", 1022 "output": [ 1023 [ 1024 "StartTag", 1025 "math", 1026 {} 1027 ], 1028 [ 1029 "StartTag", 1030 "annotation-xml", 1031 {} 1032 ], 1033 [ 1034 "Character", 1035 " " 1036 ], 1037 [ 1038 "EndTag", 1039 "annotation-xml" 1040 ] 1041 ] 1042 }, 1043 { 1044 "description": "<math><annotation-xml>c</annotation-xml>", 1045 "input": "<math><annotation-xml>c</annotation-xml>", 1046 "output": [ 1047 [ 1048 "StartTag", 1049 "math", 1050 {} 1051 ], 1052 [ 1053 "StartTag", 1054 "annotation-xml", 1055 {} 1056 ], 1057 [ 1058 "Character", 1059 "c" 1060 ], 1061 [ 1062 "EndTag", 1063 "annotation-xml" 1064 ] 1065 ] 1066 }, 1067 { 1068 "description": "<math><annotation-xml><!--foo-->", 1069 "input": "<math><annotation-xml><!--foo-->", 1070 "output": [ 1071 [ 1072 "StartTag", 1073 "math", 1074 {} 1075 ], 1076 [ 1077 "StartTag", 1078 "annotation-xml", 1079 {} 1080 ], 1081 [ 1082 "Comment", 1083 "foo" 1084 ] 1085 ] 1086 }, 1087 { 1088 "description": "<math><annotation-xml></svg>x", 1089 "input": "<math><annotation-xml></svg>x", 1090 "output": [ 1091 [ 1092 "StartTag", 1093 "math", 1094 {} 1095 ], 1096 [ 1097 "StartTag", 1098 "annotation-xml", 1099 {} 1100 ], 1101 [ 1102 "EndTag", 1103 "svg" 1104 ], 1105 [ 1106 "Character", 1107 "x" 1108 ] 1109 ] 1110 }, 1111 { 1112 "description": "<math><annotation-xml><svg>x", 1113 "input": "<math><annotation-xml><svg>x", 1114 "output": [ 1115 [ 1116 "StartTag", 1117 "math", 1118 {} 1119 ], 1120 [ 1121 "StartTag", 1122 "annotation-xml", 1123 {} 1124 ], 1125 [ 1126 "StartTag", 1127 "svg", 1128 {} 1129 ], 1130 [ 1131 "Character", 1132 "x" 1133 ] 1134 ] 1135 } 1136 ] 1137}