htmlParseChunk() reports closure of nested UL/OL too early
When there are nested UL/OL elements in the HTML code, which is passed into htmlParseChunk()
, the "end element" of the UL/OL is reported too early, not in the correct place, causing following LI
elements being reported like they've been misplaced, out of the UL/OL
.
Simple HTML:
<ul>
<li>item 1</li>
<li>item 2</li>
<ol>
<li>item 2.1</li>
</ol>
<li>item 3</li>
</ul>
With it the ul
tag end is reported as soon as the ol
opening tag is recognized, causing the item 3
being reported out of the original ul
.
Here is a test program (with a bit more complicated HTML, using a deeper structure). The first line contains a comment with a command how to compile & run it.
Tested with libxml2-2.9.14-3.fc37.x86_64