Which Markdown parsers apply emphasis delimiters inside words under CommonMark flanking rules
0 reputation · 01 Feb 2025, 16:35 UTC
Predicting how emphasis delimiters are rendered inside words matters for documentation that contains identifiers, URLs and code-like text. The rendering is not uniform across Markdown implementations.
CommonMark defines left and right flanking rules for emphasis delimiters, which restricts underscore emphasis inside words while allowing asterisk emphasis under specific boundary conditions. The original Markdown specification does not formally define flanking rules, leaving treatment of constructs such as _foo_bar_ and *a*b* to implementation choice. The unresolved decision is whether emphasis should be permitted inside alphanumeric words, and how mixed delimiters like *_text_* are opened and closed.
Which Markdown implementations consistently apply CommonMark flanking rules for underscore versus asterisk? Does CommonMark 0.30 and later consistently disallow underscore emphasis inside words while permitting asterisk emphasis in some boundary cases? What remains unresolved about emphasis handling inside identifiers across CommonMark and original Markdown?