Skip to content

MD036 - no-emphasis-as-heading

Description

This rule checks for paragraphs that consist entirely of bold or italic text, which may indicate the author is using emphasis instead of a proper heading. Paragraphs that end with punctuation are not flagged, as they are likely intended to be emphasized sentences rather than headings.

Rationale

Using emphasis instead of a heading prevents tools from inferring the structure of a document. Proper headings enable document parsing, navigation, and accessibility features that emphasized text cannot provide.

Configuration

punctuation

Characters considered as trailing punctuation.

  • Default: .,;:!?

Examples

Invalid

# Proper Heading

**This is used as a heading**

Some text under the emphasis heading.

_Another emphasis heading_

More text here.

***Bold and italic heading***

Valid

# Proper Heading

This is a paragraph with **bold text** in it.

Another paragraph with *italic text* and more words.

**This line ends with punctuation.**

_This also ends with punctuation:_

Some text with **emphasis** that is not the whole paragraph.