The emphasis delimiters
_ are parsed differently when proceeded by a hard linebreak. For example, compare the ASTs of
Only the latter, with the ending
** delimiter, is parsed as strong emphasis. The former is parsed into three text elements: [’__’, ‘strong’, ‘__’]. Why?
I can’t tell from the spec whether this – admittedly surprising – result is intentional or not.
Asterisks work inside words, underscores do not. A forced line break should clearly count as a word boundary and therefore this is a bug.
@Crissov Is this a confirmed bug? I.e. shall I fix it?
All Commonmark implementations except
commonmark.js agree on this, see Babelmark.
Now filed as an issue at Github:
Thank you for creating a Github Issue, Christoph.