MD026 - no-trailing-punctuation¶
Description¶
This rule checks that headings do not end with punctuation characters. By default, it flags periods, commas, semicolons, colons, and exclamation marks, including their full-width forms. Question marks are allowed by default since they are common in FAQ-style headings. A trailing HTML entity (©) or emoji shortcode (:rocket:) is not punctuation.
Fixable: Yes
Rationale¶
Headings are not meant to be full sentences. Trailing punctuation in headings is unnecessary and inconsistent with most style guides.
Configuration¶
punctuation-
Characters considered as trailing punctuation. The default also includes the full-width forms used in CJK text.
- Default:
.,;:!。,;:!
- Default:
Examples¶
Invalid¶
# Heading with period.
## Heading with colon:
### Heading with semicolon;
This document has headings with trailing punctuation.
Valid¶
# Heading without punctuation
## Another clean heading
### Question marks are allowed?
This document has proper headings.