Skip to content

Latest commit

 

History

History
90 lines (59 loc) · 1.93 KB

File metadata and controls

90 lines (59 loc) · 1.93 KB

MD049 - Emphasis style

Aliases: emphasis-style
Tags: emphasis
Fixable: Some violations can be fixed by tooling

Rule Description

This rule is triggered when the symbols used in the document for emphasis do not match the configured emphasis style:

*Text*
_Text_

To fix this issue, use the configured emphasis style throughout the document:

*Text*
*Text*

The configured emphasis style can be a specific symbol to use (asterisk, underscore) or can require all emphasis matches the first emphasis (consistent).

Note: Emphasis within a word is restricted to asterisk in order to avoid unwanted emphasis for words containing internal underscores like_this_one.

Configuration

  • style: Emphasis style (string, default consistent, values asterisk / consistent / underscore)

Example Configuration

[linters.settings.emphasis-style]
style = "asterisk"

Examples

Valid (consistent mode)

This paragraph uses *consistent* asterisk emphasis throughout the *entire* document.
This paragraph uses _consistent_ underscore emphasis throughout the _entire_ document.

Invalid (consistent mode)

This paragraph *uses* both _kinds_ of emphasis marker.

Valid (asterisk mode)

This paragraph uses *only* asterisk emphasis *throughout*.

Invalid (asterisk mode)

This paragraph uses *asterisk* and _underscore_ emphasis.

Valid (underscore mode)

This paragraph uses _only_ underscore emphasis _throughout_.

Invalid (underscore mode)

This paragraph uses _underscore_ and *asterisk* emphasis.

Special Cases

Intraword emphasis is always allowed with asterisk regardless of the configured style:

This apple*banana*cherry intraword emphasis is always valid.

Rationale

Consistent formatting makes it easier to understand a document.