[GH-ISSUE #58] spurious warnings about question or exclamation marks in a header #1894

Closed
opened 2026-03-07 20:02:31 +03:00 by kerem · 5 comments
Owner

Originally created by @wbolster on GitHub (May 5, 2017).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/58

a header like this one:

# Why?

produces a MD026 warning about trailing punctutation in the header. the same happens when an exclamation mark is used.

this should not happen.

Originally created by @wbolster on GitHub (May 5, 2017). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/58 a header like this one: ``` markdown # Why? ``` produces a `MD026` warning about trailing punctutation in the header. the same happens when an exclamation mark is used. this should not happen.
kerem 2026-03-07 20:02:31 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (May 5, 2017):

What do you think is wrong here?

The documentation for MD026 explicitly calls out that it will trigger for ? and !:
https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md026---trailing-punctuation-in-header

If you do not like this rule, it can be disabled completely - or you can edit the list of characters it looks for (again, see documentation above).

<!-- gh-comment-id:299562320 --> @DavidAnson commented on GitHub (May 5, 2017): What do you think is wrong here? The documentation for `MD026` explicitly calls out that it will trigger for `?` and `!`: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md026---trailing-punctuation-in-header If you do not like this rule, it can be disabled completely - or you can edit the list of characters it looks for (again, see documentation above).
Author
Owner

@wbolster commented on GitHub (May 6, 2017):

what i think is wrong here is that the defaults are not sensible enough. :)

having a question mark at the end of a header is quite common (e.g. faqs), and requiring explicit configuration for it seems backwards to me.

<!-- gh-comment-id:299637807 --> @wbolster commented on GitHub (May 6, 2017): what i think is wrong here is that the defaults are not sensible enough. :) having a question mark at the end of a header is quite common (e.g. faqs), and requiring explicit configuration for it seems backwards to me.
Author
Owner

@DavidAnson commented on GitHub (May 6, 2017):

Fair enough. :) For what it's worth, this rule came from the Ruby implementation. I'll admit it's not my absolute favorite rule, but I think it's a good guideline in general, it's easy to turn off if you don't want it, and it's easy to customize when needed. I'm not inclined to break compatibility with the Ruby implementation over something like this, so unless you find that the rule is behaving wrongly, I will recommend turning it off. Sorry for the inconvenience!

<!-- gh-comment-id:299655370 --> @DavidAnson commented on GitHub (May 6, 2017): Fair enough. :) For what it's worth, this rule came from the Ruby implementation. I'll admit it's not my absolute favorite rule, but I think it's a good guideline in general, it's easy to turn off if you don't want it, and it's easy to customize when needed. I'm not inclined to break compatibility with the Ruby implementation over something like this, so unless you find that the rule is behaving wrongly, I will recommend turning it off. Sorry for the inconvenience!
Author
Owner

@wbolster commented on GitHub (May 6, 2017):

yeah i understand you took the rules from another project (unsure why there are 2 implementations though), but i was not aware that you aim for keeping those rules unchanged, even when they do not make sense as defaults.

thanks for the explanation.

<!-- gh-comment-id:299662714 --> @wbolster commented on GitHub (May 6, 2017): yeah i understand you took the rules from another project (unsure why there are 2 implementations though), but i was not aware that you aim for keeping those rules unchanged, even when they do not make sense as defaults. thanks for the explanation.
Author
Owner

@petk commented on GitHub (Apr 21, 2019):

Hello, worth noting, that headings in writings can include question marks an exclamation marks. Yes, one of the more strange settings.

<!-- gh-comment-id:485249186 --> @petk commented on GitHub (Apr 21, 2019): Hello, worth noting, that headings in writings can include question marks an exclamation marks. Yes, one of the more strange settings.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#1894
No description provided.