bobtfish / text-markdown

The perl Text::Markdown CPAN module
Other
50 stars 21 forks source link

Incorrectly parses certain embedded html #25

Open mvgrimes opened 11 years ago

mvgrimes commented 11 years ago

The following html (which was embedded in a large markdown file):

<!-- comment -->
<style>
</style>
<div>
</div>
<!-- comment -->

is incorrectly converted into:

<!-- comment -->
<style>
</style>

1c450cea280a1905a112821f9f56ad46

<!-- comment -->

This occurs for any HTML block following the style section (ie, form, p).

daleevans commented 9 years ago

This problem occurs when processing any block level element that is surrounded by an HTML comment. A mimimal test case is:

<!--

<div></div>

-->

This is because we hashify block level elements, and then we hashify comments, but we don't continue de-hashing until there are no more hashes.

Fixed: https://github.com/bobtfish/text-markdown/pull/31