mity / md4c

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

~`foo`~ renders incorrectly #69

Closed sceutre closed 5 years ago

sceutre commented 5 years ago

With strikethrough turned on I see the following:

~`foo`~    // does not wrap foo in <code></code>
~*foo*~    // does not wrap foo in <em></em>
~ `foo`~   // works fine
~ *foo*~   // works fine

Looking at the code, the issue seems to be in md_collect_marks the strikethrough if block does not end in a continue

mity commented 5 years ago

Confirmed the bug as well as its culprit. Thank you.

For the sake of completeness, if nested in the inverse manner, the problem is there too:

*~foo~*

The only difference is it breaks when handling the closer mark in md_collect_marks().