HTML5Lib Test Suite vs. PH5P Parser

This document shows the result of PH5P when run against HTML5Lib’s testsuite.

tests1.dat

tests1.dat, test 1

Data:
Test
Result:
| <html>
|   <head>
|   <body>
|     "Test"
Expected:
| <html>
|   <head>
|   <body>
|     "Test"

tests1.dat, test 2

Data:
<p>One<p>Two
Result:
| <html>
|   <head>
|   <body>
|     <p>
|       "One"
|     <p>
|       "Two"
Expected:
| <html>
|   <head>
|   <body>
|     <p>
|       "One"
|     <p>
|       "Two"

tests1.dat, test 3

Data:
Line1<br>Line2<br>Line3<br>Line4
Result:
| <html>
|   <head>
|   <body>
|     "Line1"
|     <br>
|     "Line2"
|     <br>
|     "Line3"
|     <br>
|     "Line4"
Expected:
| <html>
|   <head>
|   <body>
|     "Line1"
|     <br>
|     "Line2"
|     <br>
|     "Line3"
|     <br>
|     "Line4"

tests1.dat, test 4

Data:
<html>
Result:
| <html>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 5

Data:
<head>
Result:
| <html>
|   <head>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 6

Data:
<body>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 7

Data:
<html><head>
Result:
| <html>
|   <head>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 8

Data:
<html><head></head>
Result:
| <html>
|   <head>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 9

Data:
<html><head></head><body>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 10

Data:
<html><head></head><body></body>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 11

Data:
<html><head><body></body></html>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 12

Data:
<html><head></body></html>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 13

Data:
<html><head><body></html>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 14

Data:
<html><body></html>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 15

Data:
<body></html>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 16

Data:
<head></html>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 17

Data:
</head>
Result:
| <html>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 18

Data:
</body>
Result:
| <html>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 19

Data:
</html>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 20

Data:
<b><table><td><i></table>
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <i>
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <i>

tests1.dat, test 21

Data:
<b><table><td></b><i></table>X
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <i>
|       "X"
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <i>
|       "X"

tests1.dat, test 22

Data:
<h1>Hello<h2>World
Result:
| <html>
|   <head>
|   <body>
|     <h1>
|       "Hello"
|     <h2>
|       "World"
Expected:
| <html>
|   <head>
|   <body>
|     <h1>
|       "Hello"
|     <h2>
|       "World"

tests1.dat, test 23

Data:
<a><p>X<a>Y</a>Z</p></a>
Result:
| <html>
|   <head>
|   <body>
|     <a>
|     <p>
|       <a>
|         "X"
|       <a>
|         "Y"
|       "Z"
Expected:
| <html>
|   <head>
|   <body>
|     <a>
|     <p>
|       <a>
|         "X"
|       <a>
|         "Y"
|       "Z"

tests1.dat, test 24

Data:
<b><button></b></button></b>
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       <button>
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       <button>

tests1.dat, test 25

Data:
<p><b><div><marquee></p></b></div>X
Result:
| <html>
|   <head>
|   <body>
|     <p>
|       <b>
|     <div>
|       <b>
|         <marquee>
|     "X"
Expected:
| <html>
|   <head>
|   <body>
|     <p>
|       <b>
|     <div>
|       <b>
|         <marquee>
|           "X"

tests1.dat, test 26

Data:
<script><div></script></div><title><p></title><p><p>
Result:
| <html>
|   <head>
|     <script>
|       "<"
|       "div>"
|     <title>
|       "<"
|       "p>"
|   <body>
|     <p>
|     <p>
Expected:
| <html>
|   <head>
|     <script>
|       "<div>"
|     <title>
|       "<p>"
|   <body>
|     <p>
|     <p>

tests1.dat, test 27

Data:
<!--><div>--<!-->
Result:
| <!-- ><div>--<! -->
| <html>
Expected:
| <!-- ><div>--<! -->
| <html>
|   <head>
|   <body>

tests1.dat, test 28

Data:
<p><hr></p>
Result:
| <html>
|   <head>
|   <body>
|     <p>
|     <hr>
Expected:
| <html>
|   <head>
|   <body>
|     <p>
|     <hr>

tests1.dat, test 29

Data:
<select><b><option><select><option></b></select>X
Result:
| <html>
|   <head>
|   <body>
|     <select>
Expected:
| <html>
|   <head>
|   <body>
|     <select>
|       <option>
|     "X"

tests1.dat, test 30

Data:
<a><table><td><a><table></table><a></tr><a></table><b>X</b>C<a>Y
Result:
| <html>
|   <head>
|   <body>
|     <a>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <a>
|                 <table>
|               <a>
|       <b>
|         "X"
|       "C"
|     <a>
|       "Y"
Expected:
| <html>
|   <head>
|   <body>
|     <a>
|       <a>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <a>
|                 <table>
|               <a>
|     <a>
|       <b>
|         "X"
|       "C"
|     <a>
|       "Y"

tests1.dat, test 31

Data:
<a X>0<b>1<a Y>2
Result:
| <html>
|   <head>
|   <body>
|     <a>
|       x=""
|       "0"
|       <b>
|         "1"
|     <b>
|       <a>
|         y=""
|         "2"
Expected:
| <html>
|   <head>
|   <body>
|     <a>
|       x=""
|       "0"
|       <b>
|         "1"
|     <b>
|       <a>
|         y=""
|         "2"

tests1.dat, test 32

Data:
<!-----><font><div>hello<table>excite!<b>me!<th><i>please!</tr><!--X-->
Result:
| <!-- - -->
| <html>
|   <head>
|   <body>
|     <font>
|       <div>
|         "hello"
|         <tbody>
|           <tr>
|             <th>
|               <i>
|                 "please!"
|           <!-- X -->
|         <table>
Expected:
| <!-- - -->
| <html>
|   <head>
|   <body>
|     <font>
|       <div>
|         "helloexcite!"
|         <b>
|           "me!"
|         <table>
|           <tbody>
|             <tr>
|               <th>
|                 <i>
|                   "please!"
|             <!-- X -->

tests1.dat, test 33

Data:
<!DOCTYPE HTML><li>hello<li>world<ul>how<li>do</ul>you</body><!--do-->
Result:
| <html>
|   <head>
|   <body>
|     <li>
|       "hello"
|     <li>
|       "world"
|       <ul>
|         "how"
|         <li>
|           "do"
|       "you"
|   <!-- do -->
Expected:
| <!DOCTYPE HTML>
| <html>
|   <head>
|   <body>
|     <li>
|       "hello"
|     <li>
|       "world"
|       <ul>
|         "how"
|         <li>
|           "do"
|       "you"
|   <!-- do -->

tests1.dat, test 34

Data:
<!DOCTYPE HTML>A<option>B<optgroup>C<select>D</option>E
Result:
| <html>
|   <head>
|   <body>
|     "A"
|     "B"
|     <optgroup>
|       "C"
|       <select>
Expected:
| <!DOCTYPE HTML>
| <html>
|   <head>
|   <body>
|     "ABC"
|     <select>
|       "DE"

tests1.dat, test 35

Data:
<
Result:
| <html>
|   <head>
|   <body>
|     "<"
Expected:
| <html>
|   <head>
|   <body>
|     "<"

tests1.dat, test 36

Data:
<#
Result:
| <html>
|   <head>
|   <body>
|     "<"
|     "#"
Expected:
| <html>
|   <head>
|   <body>
|     "<#"

tests1.dat, test 37

Data:
</
Result:
| <html>
|   <head>
|   <body>
|     "</"
Expected:
| <html>
|   <head>
|   <body>
|     "</"

tests1.dat, test 38

Data:
</#
Result:
| <!-- # -->
| <html>
Expected:
| <!-- # -->
| <html>
|   <head>
|   <body>

tests1.dat, test 39

Data:
<?
Result:
| <!-- ? -->
| <html>
Expected:
| <!-- ? -->
| <html>
|   <head>
|   <body>

tests1.dat, test 40

Data:
<?#
Result:
| <!-- ?# -->
| <html>
Expected:
| <!-- ?# -->
| <html>
|   <head>
|   <body>

tests1.dat, test 41

Data:
<!
Result:
| <!--  -->
| <html>
Expected:
| <!--  -->
| <html>
|   <head>
|   <body>

tests1.dat, test 42

Data:
<!#
Result:
| <!-- # -->
| <html>
Expected:
| <!-- # -->
| <html>
|   <head>
|   <body>

tests1.dat, test 43

Data:
<?COMMENT?>
Result:
| <!-- ?COMMENT? -->
| <html>
Expected:
| <!-- ?COMMENT? -->
| <html>
|   <head>
|   <body>

tests1.dat, test 44

Data:
<!COMMENT>
Result:
| <!-- COMMENT -->
| <html>
Expected:
| <!-- COMMENT -->
| <html>
|   <head>
|   <body>

tests1.dat, test 45

Data:
</ COMMENT >
Result:
| <!--  COMMENT  -->
| <html>
Expected:
| <!--  COMMENT  -->
| <html>
|   <head>
|   <body>

tests1.dat, test 46

Data:
<?COM--MENT?>
Result:
| <!-- ?COM--MENT? -->
| <html>
Expected:
| <!-- ?COM--MENT? -->
| <html>
|   <head>
|   <body>

tests1.dat, test 47

Data:
<!COM--MENT>
Result:
| <!-- COM--MENT -->
| <html>
Expected:
| <!-- COM--MENT -->
| <html>
|   <head>
|   <body>

tests1.dat, test 48

Data:
</ COM--MENT >
Result:
| <!--  COM--MENT  -->
| <html>
Expected:
| <!--  COM--MENT  -->
| <html>
|   <head>
|   <body>

tests1.dat, test 49

Data:
<!DOCTYPE HTML><style> EOF
Result:
| <html>
|   <head>
|     <style>
|       " EOF"
Expected:
| <!DOCTYPE HTML>
| <html>
|   <head>
|     <style>
|       " EOF"
|   <body>

tests1.dat, test 50

Data:
<!DOCTYPE HTML><script> <!-- </script> --> </script> EOF
Result:
| <html>
|   <head>
|     <script>
|       " "
|       "<"
|       "!-- "
|   <body>
|     " --> "
|     " EOF"
Expected:
| <!DOCTYPE HTML>
| <html>
|   <head>
|     <script>
|       " <!-- "
|     " "
|   <body>
|     "-->  EOF"

tests1.dat, test 51

Data:
<b><p></b>TEST
Result:
| <html>
|   <head>
|   <body>
|     <b>
|     <p>
|       <b>
|       "TEST"
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|     <p>
|       <b>
|       "TEST"

tests1.dat, test 52

Data:
<p id=a><b><p id=b></b>TEST
Result:
| <html>
|   <head>
|   <body>
|     <p>
|       id="a"
|       <b>
|     <p>
|       id="b"
|       <b>
|         "TEST"
Expected:
| <html>
|   <head>
|   <body>
|     <p>
|       id="a"
|       <b>
|     <p>
|       id="b"
|       "TEST"

tests1.dat, test 53

Data:
<b id=a><p><b id=b></p></b>TEST
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       id="a"
|       <p>
|         <b>
|           id="b"
|       <b>
|         id="a"
|         <b>
|           id="b"
|           "TEST"
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       id="a"
|       <p>
|         <b>
|           id="b"
|       "TEST"

tests1.dat, test 54

Data:
<!DOCTYPE HTML><title>U-test</title><body><div><p>Test<u></p></div></body>
Result:
| <html>
|   <head>
|     <title>
|       "U-test"
|   <body>
|     <div>
|       <p>
|         "Test"
|         <u>
Expected:
| <!DOCTYPE HTML>
| <html>
|   <head>
|     <title>
|       "U-test"
|   <body>
|     <div>
|       <p>
|         "Test"
|         <u>

tests1.dat, test 55

Data:
<!DOCTYPE HTML><font><table></font></table></font>
Result:
| <html>
|   <head>
|   <body>
|     <font>
|       <table>
Expected:
| <!DOCTYPE HTML>
| <html>
|   <head>
|   <body>
|     <font>
|       <table>

tests1.dat, test 56

Data:
<font><p>hello<b>cruel</font>world
Result:
| <html>
|   <head>
|   <body>
|     <font>
|     <p>
|       <font>
|         "hello"
|         <b>
|           "cruel"
|       <b>
|         "world"
Expected:
| <html>
|   <head>
|   <body>
|     <font>
|     <p>
|       <font>
|         "hello"
|         <b>
|           "cruel"
|       <b>
|         "world"

tests1.dat, test 57

Data:
<b>Test</i>Test
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       "Test"
|       "Test"
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       "TestTest"

tests1.dat, test 58

Data:
<b>A<cite>B<div>C
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       "A"
|       <cite>
|         "B"
|         <div>
|           "C"
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       "A"
|       <cite>
|         "B"
|         <div>
|           "C"

tests1.dat, test 59

Data:
<b>A<cite>B<div>C</cite>D
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       "A"
|       <cite>
|         "B"
|         <div>
|           "C"
|           "D"
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       "A"
|       <cite>
|         "B"
|         <div>
|           "CD"

tests1.dat, test 60

Data:
<b>A<cite>B<div>C</b>D
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       "A"
|       <cite>
|         "B"
|     <div>
|       <b>
|         "C"
|       "D"
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       "A"
|       <cite>
|         "B"
|     <div>
|       <b>
|         "C"
|       "D"

tests1.dat, test 61

Data:
<cite><b><cite><i><cite><i><cite><i><div>X</b>TEST
Result:
| <html>
|   <head>
|   <body>
|     <cite>
|       <b>
|         <cite>
|           <i>
|             <cite>
|               <i>
|                 <cite>
|       <i>
|         <i>
|           <i>
|             <div>
|               <b>
|                 "X"
|               "TEST"
Expected:
| <html>
|   <head>
|   <body>
|     <cite>
|       <b>
|         <cite>
|           <i>
|             <cite>
|               <i>
|                 <cite>
|       <i>
|         <i>
|           <i>
|             <div>
|               <b>
|                 "X"
|               "TEST"

tests1.dat, test 62

Data:

Result:
| <html>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 63

Data:
<DIV>
Result:
| <html>
|   <head>
|   <body>
|     <div>
Expected:
| <html>
|   <head>
|   <body>
|     <div>

tests1.dat, test 64

Data:
<DIV> abc
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc"
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc"

tests1.dat, test 65

Data:
<DIV> abc <B>
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>

tests1.dat, test 66

Data:
<DIV> abc <B> def
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def"
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def"

tests1.dat, test 67

Data:
<DIV> abc <B> def <I>
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>

tests1.dat, test 68

Data:
<DIV> abc <B> def <I> ghi
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi"
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi"

tests1.dat, test 69

Data:
<DIV> abc <B> def <I> ghi <P>
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|           <p>
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|           <p>

tests1.dat, test 70

Data:
<DIV> abc <B> def <I> ghi <P> jkl
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|           <p>
|             " jkl"
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|           <p>
|             " jkl"

tests1.dat, test 71

Data:
<DIV> abc <B> def <I> ghi <P> jkl </B>
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|           <p>
|             " jkl "
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|       <i>
|         <p>
|           <b>
|             " jkl "

tests1.dat, test 72

Data:
<DIV> abc <B> def <I> ghi <P> jkl </B> mno
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|           <p>
|             " jkl "
|             " mno"
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|       <i>
|         <p>
|           <b>
|             " jkl "
|           " mno"

tests1.dat, test 73

Data:
<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I>
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|           <p>
|             " jkl "
|             " mno "
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|       <i>
|       <p>
|         <i>
|           <b>
|             " jkl "
|           " mno "

tests1.dat, test 74

Data:
<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|           <p>
|             " jkl "
|             " mno "
|             " pqr"
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|       <i>
|       <p>
|         <i>
|           <b>
|             " jkl "
|           " mno "
|         " pqr"

tests1.dat, test 75

Data:
<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P>
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|           <p>
|             " jkl "
|             " mno "
|             " pqr "
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|       <i>
|       <p>
|         <i>
|           <b>
|             " jkl "
|           " mno "
|         " pqr "

tests1.dat, test 76

Data:
<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P> stu
Result:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|           <p>
|             " jkl "
|             " mno "
|             " pqr "
|             " stu"
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|       <i>
|       <p>
|         <i>
|           <b>
|             " jkl "
|           " mno "
|         " pqr "
|       " stu"

tests1.dat, test 77

Data:
<test attribute---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
Result:
| <html>
|   <head>
|   <body>
|     <test>
|       attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=""
Expected:
| <html>
|   <head>
|   <body>
|     <test>
|       attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=""

tests1.dat, test 78

Data:
<a href="blah">aba<table><a href="foo">br<tr><td></td></tr>x</table>aoe
Result:
| <html>
|   <head>
|   <body>
|     <a>
|       href="blah"
|       "aba"
|       <tbody>
|         <tr>
|           <td>
|       <table>
|       "aoe"
Expected:
| <html>
|   <head>
|   <body>
|     <a>
|       href="blah"
|       "aba"
|       <a>
|         href="foo"
|         "br"
|       <a>
|         href="foo"
|         "x"
|       <table>
|         <tbody>
|           <tr>
|             <td>
|     <a>
|       href="foo"
|       "aoe"

tests1.dat, test 79

Data:
<a href="blah">aba<table><tr><td><a href="foo">br</td></tr>x</table>aoe
Result:
| <html>
|   <head>
|   <body>
|     <a>
|       href="blah"
|       "aba"
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <a>
|                 href="foo"
|                 "br"
|       "aoe"
Expected:
| <html>
|   <head>
|   <body>
|     <a>
|       href="blah"
|       "abax"
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <a>
|                 href="foo"
|                 "br"
|       "aoe"

tests1.dat, test 80

Data:
<table><a href="blah">aba<tr><td><a href="foo">br</td></tr>x</table>aoe
Result:
| <html>
|   <head>
|   <body>
|     <tbody>
|       <tr>
|         <td>
|           <a>
|             href="foo"
|             "br"
|     <table>
|     "aoe"
Expected:
| <html>
|   <head>
|   <body>
|     <a>
|       href="blah"
|       "aba"
|     <a>
|       href="blah"
|       "x"
|     <table>
|       <tbody>
|         <tr>
|           <td>
|             <a>
|               href="foo"
|               "br"
|     <a>
|       href="blah"
|       "aoe"

tests1.dat, test 81

Data:
<a href=a>aa<marquee>aa<a href=b>bb</marquee>aa
Result:
| <html>
|   <head>
|   <body>
|     <a>
|       href="a"
|       "aa"
|       <marquee>
|         "aa"
|         <a>
|           href="b"
|           "bb"
|           "aa"
Expected:
| <html>
|   <head>
|   <body>
|     <a>
|       href="a"
|       "aa"
|       <marquee>
|         "aa"
|         <a>
|           href="b"
|           "bb"
|       "aa"

tests1.dat, test 82

Data:
<wbr><strike><code></strike><code><strike></code>
Result:
| <html>
|   <head>
|   <body>
|     <wbr>
|     <strike>
|       <code>
|     <code>
|       <strike>
Expected:
| <html>
|   <head>
|   <body>
|     <wbr>
|     <strike>
|       <code>
|     <code>
|       <strike>

tests1.dat, test 83

Data:
<title><meta></title><link><title><meta></title>
Result:
| <html>
|   <head>
|     <title>
|       "<"
|       "meta>"
|     <link>
|     <title>
|       "<"
|       "meta>"
Expected:
| <html>
|   <head>
|     <title>
|       "<meta>"
|     <link>
|     <title>
|       "<meta>"
|   <body>

tests1.dat, test 84

Data:
<style><!--</style><meta><script>--><link></script>
Result:
| <html>
|   <head>
|     <style>
|       "<"
|       "!--"
|     <meta>
|     <script>
|       "-->"
|       "<"
|       "link>"
Expected:
| <html>
|   <head>
|     <style>
|       "<!--"
|     <meta>
|     <script>
|       "--><link>"
|   <body>

tests1.dat, test 85

Data:
<head><meta></head><link>
Result:
| <html>
|   <head>
|     <meta>
|     <link>
Expected:
| <html>
|   <head>
|     <meta>
|     <link>
|   <body>

tests1.dat, test 86

Data:
<table><tr><tr><td><td><span><th><span>X</table>
Result:
| <html>
|   <head>
|   <body>
|     <table>
|       <tbody>
|         <tr>
|         <tr>
|           <td>
|           <td>
|             <span>
|           <th>
|             <span>
|               "X"
Expected:
| <html>
|   <head>
|   <body>
|     <table>
|       <tbody>
|         <tr>
|         <tr>
|           <td>
|           <td>
|             <span>
|           <th>
|             <span>
|               "X"

tests1.dat, test 87

Data:
<body><body><base><link><meta><title><p></title><body><p></body>
Result:
| <html>
|   <head>
|     <base>
|     <link>
|     <meta>
|     <title>
|       "<"
|       "p>"
|   <body>
|   "<"
|   "body>"
|   "<"
|   "p>"
|   "</"
|   "body>"
Expected:
| <html>
|   <head>
|     <base>
|     <link>
|     <meta>
|     <title>
|       "<p>"
|   <body>
|     <p>

tests1.dat, test 88

Data:
<textarea><p></textarea>
Result:
| <html>
|   <head>
|   <body>
|     <textarea>
|       "<"
|       "p>"
Expected:
| <html>
|   <head>
|   <body>
|     <textarea>
|       "<p>"

tests1.dat, test 89

Data:
<p><image></p>
Result:
| <html>
|   <head>
|   <body>
|     <p>
|       <img>
Expected:
| <html>
|   <head>
|   <body>
|     <p>
|       <img>

tests1.dat, test 90

Data:
<a><table><a></table><p><a><div><a>
Result:
| <html>
|   <head>
|   <body>
|     <a>
|       <table>
|     <p>
|       <a>
|       <a>
|     <div>
|       <a>
|         <a>
Expected:
| <html>
|   <head>
|   <body>
|     <a>
|       <a>
|       <table>
|     <p>
|       <a>
|     <div>
|       <a>

tests1.dat, test 91

Data:
<head></p><meta><p>
Result:
| <html>
|   <head>
|     <meta>
|   <body>
|     <p>
Expected:
| <html>
|   <head>
|     <meta>
|   <body>
|     <p>

tests1.dat, test 92

Data:
<head></html><meta><p>
Result:
| <html>
|   <head>
|     <meta>
|   <body>
|     <p>
Expected:
| <html>
|   <head>
|     <meta>
|   <body>
|     <p>

tests1.dat, test 93

Data:
<b><table><td><i></table>
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <i>
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <i>

tests1.dat, test 94

Data:
<b><table><td></b><i></table>
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <i>
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <i>

tests1.dat, test 95

Data:
<h1><h2>
Result:
| <html>
|   <head>
|   <body>
|     <h1>
|     <h2>
Expected:
| <html>
|   <head>
|   <body>
|     <h1>
|     <h2>

tests1.dat, test 96

Data:
<a><p><a></a></p></a>
Result:
| <html>
|   <head>
|   <body>
|     <a>
|     <p>
|       <a>
|       <a>
Expected:
| <html>
|   <head>
|   <body>
|     <a>
|     <p>
|       <a>
|       <a>

tests1.dat, test 97

Data:
<b><button></b></button></b>
Result:
| <html>
|   <head>
|   <body>
|     <b>
|       <button>
Expected:
| <html>
|   <head>
|   <body>
|     <b>
|       <button>

tests1.dat, test 98

Data:
<p><b><div><marquee></p></b></div>
Result:
| <html>
|   <head>
|   <body>
|     <p>
|       <b>
|     <div>
|       <b>
|         <marquee>
Expected:
| <html>
|   <head>
|   <body>
|     <p>
|       <b>
|     <div>
|       <b>
|         <marquee>

tests1.dat, test 99

Data:
<script></script></div><title></title><p><p>
Result:
| <html>
|   <head>
|     <script>
|     <title>
|   <body>
|     <p>
|     <p>
Expected:
| <html>
|   <head>
|     <script>
|     <title>
|   <body>
|     <p>
|     <p>

tests1.dat, test 100

Data:
<p><hr></p>
Result:
| <html>
|   <head>
|   <body>
|     <p>
|     <hr>
Expected:
| <html>
|   <head>
|   <body>
|     <p>
|     <hr>

tests1.dat, test 101

Data:
<select><b><option><select><option></b></select>
Result:
| <html>
|   <head>
|   <body>
|     <select>
Expected:
| <html>
|   <head>
|   <body>
|     <select>
|       <option>

tests1.dat, test 102

Data:
<html><head><title></title><body></body></html>
Result:
| <html>
|   <head>
|     <title>
|   <body>
Expected:
| <html>
|   <head>
|     <title>
|   <body>

tests1.dat, test 103

Data:
<a><table><td><a><table></table><a></tr><a></table><a>
Result:
| <html>
|   <head>
|   <body>
|     <a>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <a>
|                 <table>
|               <a>
|       <a>
Expected:
| <html>
|   <head>
|   <body>
|     <a>
|       <a>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <a>
|                 <table>
|               <a>
|     <a>

tests1.dat, test 104

Data:
<ul><li></li><div><li></div><li><li><div><li><address><li><b><em></b><li></ul>
Result:
| <html>
|   <head>
|   <body>
|     <ul>
|       <li>
|       <div>
|         <li>
|       <li>
|       <li>
|         <div>
|       <li>
|         <address>
|       <li>
|         <b>
|           <em>
|       <li>
Expected:
| <html>
|   <head>
|   <body>
|     <ul>
|       <li>
|       <div>
|         <li>
|       <li>
|       <li>
|         <div>
|       <li>
|         <address>
|       <li>
|         <b>
|           <em>
|       <li>

tests1.dat, test 105

Data:
<frameset><frame><frameset><frame></frameset><noframes></noframes></frameset>
Result:
| <html>
|   <head>
|   <frameset>
Expected:
| <html>
|   <head>
|   <frameset>
|     <frame>
|     <frameset>
|       <frame>
|     <noframes>

tests1.dat, test 106

Data:
<body><frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes>
Result:
| <html>
|   <head>
|   <body>
|     <noframes>
|       "</"
|       "frameset>"
|       "<"
|       "noframes>"
Expected:
| <html>
|   <head>
|   <body>
|     <noframes>
|       "</frameset><noframes>"

tests1.dat, test 107

Data:
<h1><table><td><h3></table><h3></h1>
Result:
| <html>
|   <head>
|   <body>
|     <h1>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <h3>
|     <h3>
Expected:
| <html>
|   <head>
|   <body>
|     <h1>
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <h3>
|     <h3>

tests1.dat, test 108

Data:
<table><colgroup><col><colgroup><col><col><col><colgroup><col><col><thead><tr><td></table>
Result:
| <html>
|   <head>
|   <body>
|     <table>
|       <colgroup>
|         <col>
|       <colgroup>
|         <col>
|         <col>
|         <col>
|       <colgroup>
|         <col>
|         <col>
|       <thead>
|         <tr>
|           <td>
Expected:
| <html>
|   <head>
|   <body>
|     <table>
|       <colgroup>
|         <col>
|       <colgroup>
|         <col>
|         <col>
|         <col>
|       <colgroup>
|         <col>
|         <col>
|       <thead>
|         <tr>
|           <td>

tests1.dat, test 109

Data:
<table><col><tbody><col><tr><col><td><col></table><col>
Result:
| <html>
|   <head>
|   <body>
|     <table>
|       <colgroup>
|         <col>
|       <tbody>
|       <colgroup>
|         <col>
|       <tbody>
|         <tr>
|         <tr>
|           <td>
Expected:
| <html>
|   <head>
|   <body>
|     <table>
|       <colgroup>
|         <col>
|       <tbody>
|       <colgroup>
|         <col>
|       <tbody>
|         <tr>
|       <colgroup>
|         <col>
|       <tbody>
|         <tr>
|           <td>
|       <colgroup>
|         <col>

tests1.dat, test 110

Data:
<table><colgroup><tbody><colgroup><tr><colgroup><td><colgroup></table><colgroup>
Result:
| <html>
|   <head>
|   <body>
|     <table>
|       <colgroup>
|       <tbody>
|       <colgroup>
|       <tbody>
|         <tr>
|         <tr>
|           <td>
Expected:
| <html>
|   <head>
|   <body>
|     <table>
|       <colgroup>
|       <tbody>
|       <colgroup>
|       <tbody>
|         <tr>
|       <colgroup>
|       <tbody>
|         <tr>
|           <td>
|       <colgroup>

tests1.dat, test 111

Data:
</strong></b></em></i></u></strike></s></blink></tt></pre></big></small></font></select></h1></h2></h3></h4></h5></h6></body></br></a></img></title></span></style></script></table></th></td></tr></frame></area></link></param></hr></input></col></base></meta></basefont></bgsound></embed></spacer></p></dd></dt></caption></colgroup></tbody></tfoot></thead></address></blockquote></center></dir></div></dl></fieldset></listing></menu></ol></ul></li></nobr></wbr></form></button></marquee></object></html></frameset></head></iframe></image></isindex></noembed></noframes></noscript></optgroup></option></plaintext></textarea>
Result:
| <html>
|   <head>
|   <body>
Expected:
| <html>
|   <head>
|   <body>

tests1.dat, test 112

Data:
<table><tr></strong></b></em></i></u></strike></s></blink></tt></pre></big></small></font></select></h1></h2></h3></h4></h5></h6></body></br></a></img></title></span></style></script></table></th></td></tr></frame></area></link></param></hr></input></col></base></meta></basefont></bgsound></embed></spacer></p></dd></dt></caption></colgroup></tbody></tfoot></thead></address></blockquote></center></dir></div></dl></fieldset></listing></menu></ol></ul></li></nobr></wbr></form></button></marquee></object></html></frameset></head></iframe></image></isindex></noembed></noframes></noscript></optgroup></option></plaintext></textarea>
Result:
| <html>
|   <head>
|   <body>
|     <table>
|       <tbody>
|         <tr>
Expected:
| <html>
|   <head>
|   <body>
|     <table>
|       <tbody>
|         <tr>

tests2.dat

tests2.dat, test 1

Data:
<!doctype html>Test
Result:
| <html>
|   <head>
|   <body>
|     "Test"
Expected:
| <!DOCTYPE HTML>
| <html>
|   <head>
|   <body>
|     "Test"

tests2.dat, test 2

Data:
<textarea>test</div>test
Result:
| <html>
|   <head>
|   <body>
|     <textarea>
|       "test"
|       "</"
|       "div>test"
Expected:
| <html>
|   <head>
|   <body>
|     <textarea>
|       "test</div>test"

tests2.dat, test 3

Data:
<table><td>
Result:
| <html>
|   <head>
|   <body>
|     <table>
|       <tbody>
|         <tr>
|           <td>
Expected:
| <html>
|   <head>
|   <body>
|     <table>
|       <tbody>
|         <tr>
|           <td>

tests2.dat, test 4

Data:
<table><td>test</tbody></table>