MD037 - Review spaces in apparent emphasis¶
Aliases: no-space-in-emphasis
What this rule does¶
Reports spaces between apparent emphasis markers (asterisks or underscores) and their text for manual review. Spaced markers can also be intentional literal characters, such as multiplication signs.
Why this matters¶
Spaced markers may be accidental formatting or intentional literal text. Review the diagnostic to make your intent clear without changing document meaning.
Examples¶
✅ Correct¶
Emphasis markers directly touch the text:
This is *italic* text.
This is **bold** text.
This is ***bold italic*** text.
Using _underscores_ also works.
⚠️ Flagged¶
Spaced markers that are reported:
This is * italic with spaces * text.
This is ** bold with spaces ** text.
This is * space at start* text.
This is *space at end * text.
Manually corrected¶
If emphasis was intended, remove the spaces manually:
This is *italic with spaces* text.
This is **bold with spaces** text.
This is *space at start* text.
This is *space at end* text.
Configuration¶
This rule has no configuration options.
Special cases¶
* and _ inside a template shortcode tag ({{% a * y * b %}},
{{< a * y * b >}}) are literal characters the template receives as arguments,
not emphasis markers, so they are not reported. Only the tag is
exempt: the body between a paired opening and closing shortcode is ordinary
Markdown and is still checked.
Automatic fixes¶
This rule does not offer automatic fixes. Under CommonMark, whitespace next to
an opening or closing marker prevents that marker from opening or closing
emphasis. Removing the whitespace can create formatting the author never
intended: parts * 3 * the part size would become parts *3* the part size,
turning a literal multiplication expression into italics.
Review the warning manually. If you intended emphasis, remove the inner spaces.
If the markers are literal, escape them (for example, parts \* 3 \* the part size),
use a code span, or suppress MD037 for that text. rumdl check --fix, rumdl fmt,
and editor quick fixes leave these pairs unchanged.
Learn more¶
Related rules¶
- MD049 - Emphasis style - Choose between asterisks or underscores
- MD050 - Strong style - Choose bold marker style
- MD036 - No emphasis as heading - Use real headings instead of bold text