miyuchina / mistletoe

A fast, extensible and spec-compliant Markdown parser in pure Python.
MIT License
811 stars 113 forks source link

Emphasized code span #120

Closed michaelforney closed 2 years ago

michaelforney commented 2 years ago

I noticed that mistletoe disagrees with cmark for the input **`foo`**. cmark produces <p><strong><code>foo</code></strong></p> while mistletoe produces <p>**<code>foo</code>**</p>.

If the initial ** is followed by some other letter, like **a`foo`**, then they both produce the same output.

I believe this is a bug since the CommonMark spec says that a left-flanking delimiter run may be followed by a Unicode punctuation character (in this case `) if it is preceded by Unicode whitespace or punctuation (and the beginning of the line is considered whitesepace).

pbodnar commented 2 years ago

@michaelforney, thanks for your report - this is in fact covered by #70 already. But at least you've made me to look at it more closely this time and I think I've already found the culprit. :)