Parsing valid HTML 4.01 that omits optional end tags results in an incorrect parse tree.
For example,
input: <ul><li>a<li>b</ul>
is parsed as: <ul><li>a<li>b</li></li></ul>
but should be: <ul><li>a</li><li>b</li></ul>
In practice, this means that quite commonly html documents are parsed incorrectly. The bug does not apply to
all optional end tags; e.g. <p> tags are correctly auto-closed.
Example document:
<html><body>
<ul><li>TestElem1
<li>TestElem2
<li>TestElem3 List:
<ul><li>Nested1
<li>Nested2</li>
<li>Nested3
</ul>
<li>TestElem4
</ul>
<p>paragraph 1
<p>paragraph 2
<p>paragraph 3
</body></html>