vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Produces invalid HTML on nested HTML divs #139

Open sol opened 11 years ago

sol commented 11 years ago

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.

sol commented 11 years ago

Seems that this is a duplicate of #134. I still leave it open, because my test case is minimal.

sol commented 11 years ago

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>
mildsunrise commented 9 years ago

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.