Tags: whitespace, emphasis
Aliases: no-space-in-emphasis
Fixable: Yes
This rule is triggered when emphasis markers (asterisks and underscores) are used, but they have spaces between the markers and the text:
Here is some * emphasis * and **bold**.
Here is some _ emphasis _ and __bold__.To fix this, remove the spaces:
Here is some *emphasis* and **bold**.
Here is some _emphasis_ and __bold__.Rationale: Emphasis is meant to be used inline, and spaces within the markers make it less visually distinct. Per the CommonMark specification, emphasis markers with spaces inside are not considered emphasis:
A
*character can open emphasis iff (if and only if) it is part of a left- flanking delimiter run. A*character can close emphasis iff it is part of a right-flanking delimiter run.A delimiter run is a sequence of one or more delimiter characters. A left-flanking delimiter run is a delimiter run that is:
- not followed by Unicode whitespace, and