Closed xiaq closed 9 months ago
Interestingly, my Haskell implementation (jgm/commonmark-hs) gets
<p>_<em><strong>a</strong>!<strong>!</strong></em></p>
As do older versions of commonmark.js - so this must have been introduced in a change after 0.28.1.
Sorry for the line noise, it was discovered when I was fuzzing my Markdown parser and I haven't been able to reduce it to a smaller case.
The following Markdown:
generates the following output:
However, none of the rules in https://spec.commonmark.org/0.30/#emphasis-and-strong-emphasis seems to prohibit the second
_
and the last_
to be paired to form another emphasis, thus becoming:Interestingly, if I replace all
_
with*
I do get the desired output, and in this particular case the distinction shouldn't matter.commonmark.js has the same behavior: https://spec.commonmark.org/dingus/?text=____a__!__!___. But GitHub's Markdown implementation has the behavior I expect: __a!__!___