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 (including full-width forms such as 。) are not flagged, as they are likely intended to be emphasized sentences rather than headings.
Fixable: No
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. The default also includes the full-width forms used in CJK text.
- Default:
.,;:!?。,;:!?
- 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.