HaxeFoundation / haxe-markdown

A Markdown parser in Haxe.
MIT License
63 stars 24 forks source link

Inline HTML doesn't always render correctly #28

Open desttinghim opened 7 years ago

desttinghim commented 7 years ago

I've run into some unexpected behavior while parsing markdown documents with inline HTML.

Take this markdown for example:

<div>

# Test
test test test

</div>

When parsed, this is what I would expect:

<div>
    <h1>Test</h1>
    <p>test test test</p>
</div>

But that is not what results. This is the output from running the markdown through Markdown.markdownToHTML:

<div>
    <h1>Test</h1>
    <p>test test test</p>
<p></div></p>

As you can see, there are p tags surrounding the closing div. Now, this will render just fine in browsers, but it is not correct HTML. If there are no problems with it, I would suggest making the parse match the expected result I show. I might be able to help, but I would need some guidance on what to change.