mity / md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
MIT License
755 stars 138 forks source link

HTML text area block not closed #207

Closed step- closed 5 months ago

step- commented 5 months ago

Consider the following test subject

<textarea>

*foo*

_bar_

</textarea>

baz

The HTML textarea block should be closed and "baz" should be rendered as a paragraph.

cmark output:


*foo*

_bar_

</textarea>
<p>baz</p>

md2html output:

<textarea>

*foo*

_bar_

</textarea>

baz

which, I think, indicates that the HTML block was still open when baz was parsed.

I don't need a fix. I just want to record this issue.

mity commented 5 months ago

Ohh yes, <textarea> was added in some later spec revision and clearly it has been added only into the opening condition check. I'll reorg it so that md_is_html_block_end_condition() reuses the same data structure to avoid such inconsistencies if that happens again.

step- commented 5 months ago

Excellent fix, verified on my test suite. Thank you.