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