mixmark-io / turndown

🛏 An HTML to Markdown converter written in JavaScript
https://mixmark-io.github.io/turndown
MIT License
8.52k stars 864 forks source link

Emphasis doesn't work within a word with `_` #441

Open Aloso opened 1 year ago

Aloso commented 1 year ago

turndown uses _ by default for emphasis (italic text), but this doesn't work within a word.

Bru<em>ss</em>el<em>s</em> is spelled with 3 <em>s</em>'s.

The problem is that CommonMark only recognizes underscores at word boundaries. To make emphasis work in the above situation, * should be used by default, which CommonMark recognizes even within a word:

Bru*ss*el*s* is spelled with 3 *s*'s.