sundown
sundown copied to clipboard
Produces invalid HTML on nested HTML divs
Steps to reproduce
Parse/render the following input:
<div>
<div>
foobar
</div>
</div>
Expected result:
<div>
<div>fobar</div>
</div>
Actual result:
<div>
<div>fobar</div>
<p>
</div>
</p>
Bablemark says that Markdown.pl 1.0.1 has the same bug. So you could probably argue that this is the intended behavior. But personally I think it's a bug. I think there is no use case for producing invalid HTML.
Seems that this is a duplicate of #134. I still leave it open, because my test case is minimal.
Ok, after reading the C source it is evident, that I can work around this by indenting nested HTML, e.g.:
<div>
<div>
foobar
</div>
</div>
This is a consequence of how Sundown looks for the ending tag.
We've just improved HTML processing in Hoedown so the above cases should work just fine, see hoedown#104.