2022-10-30 15:13:19 -07:00
|
|
|
# `MD026` - Trailing punctuation in heading
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2023-11-09 20:05:30 -08:00
|
|
|
Tags: `headings`
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-10-30 15:13:19 -07:00
|
|
|
Aliases: `no-trailing-punctuation`
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2023-07-29 15:20:10 -07:00
|
|
|
- `punctuation`: Punctuation characters (`string`, default `.,;:!。,;:!`)
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-12-16 13:53:03 -08:00
|
|
|
Fixable: Some violations can be fixed by tooling
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
This rule is triggered on any heading that has one of the specified normal or
|
|
|
|
full-width punctuation characters as the last character in the line:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
# This is a heading.
|
|
|
|
```
|
|
|
|
|
|
|
|
To fix this, remove the trailing punctuation:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
# This is a heading
|
|
|
|
```
|
|
|
|
|
|
|
|
Note: The `punctuation` parameter can be used to specify what characters count
|
|
|
|
as punctuation at the end of a heading. For example, you can change it to
|
|
|
|
`".,;:"` to allow headings that end with an exclamation point. `?` is
|
2022-11-05 17:34:37 -07:00
|
|
|
allowed by default because of how common it is in headings of FAQ-style
|
|
|
|
documents. Setting the `punctuation` parameter to `""` allows all characters -
|
|
|
|
and is equivalent to disabling the rule.
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Note: The trailing semicolon of [HTML entity references][html-entity-references]
|
2022-10-29 23:21:45 -07:00
|
|
|
like `©`, `©`, and `©` is ignored by this rule.
|
|
|
|
|
|
|
|
Rationale: Headings are not meant to be full sentences. More information:
|
2022-11-05 17:34:37 -07:00
|
|
|
[Punctuation at the end of headers][end-punctuation].
|
|
|
|
|
|
|
|
[end-punctuation]: https://cirosantilli.com/markdown-style-guide#punctuation-at-the-end-of-headers
|
|
|
|
[html-entity-references]: https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
|