[GH-ISSUE #276] Headings can be questions (MD026) #2085

Closed
opened 2026-03-07 20:04:23 +03:00 by kerem · 13 comments
Owner

Originally created by @jamescoleuk on GitHub (Apr 23, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/276

Thanks for the great library.

The default string for MD026 includes '?' and it should not.

In the documentation there is a link to a page as rationale. This page only mentions full stops, not anything else.

Other style guides also recommend against including a full stop at the end of a heading (e.g. The Economists's Style Guide, but don't mention any other punctuation.

It's perfectly legitimate and common (see this issue) to have a heading that is also a question. The '?' should be removed from the default string for MD026.

Originally created by @jamescoleuk on GitHub (Apr 23, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/276 Thanks for the great library. The default string for MD026 includes '?' and it should not. In the [documentation](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md026---trailing-punctuation-in-heading) there is a link to a page as [rationale](https://cirosantilli.com/markdown-style-guide#punctuation-at-the-end-of-headers). This page only mentions full stops, not anything else. Other style guides also recommend against including a full stop at the end of a heading (e.g. [The Economists's Style Guide](https://bordeure.files.wordpress.com/2008/11/the-economist-style-guide.pdf), but don't mention any other punctuation. It's perfectly legitimate and common (see [this issue](https://github.com/DavidAnson/vscode-markdownlint/issues/54)) to have a heading that is also a question. The '?' should be removed from the default string for MD026.
kerem 2026-03-07 20:04:23 +03:00
Author
Owner

@PeterConstable commented on GitHub (May 19, 2020):

A more basic question is, what should a lint be enforcing:

  • syntactic constraints of a programming / markup language
  • styling guidelines for the programming / markup language
  • editorial styling guidelines for the content language

Certainly Yes for the first, maybe for the second, but not the third.

I encountered this when I went to use ! at the end of a heading. I really didn't expect a lint to tell me not to do that because of editorial styling rules.

If there were a syntactic issue, like final punctuation creating havoc with heading links, that would be a different matter.

<!-- gh-comment-id:630832039 --> @PeterConstable commented on GitHub (May 19, 2020): A more basic question is, what should a lint be enforcing: * syntactic constraints of a programming / markup language * styling guidelines for the programming / markup language * editorial styling guidelines for the content language Certainly Yes for the first, maybe for the second, but not the third. I encountered this when I went to use ! at the end of a heading. I really didn't expect a lint to tell me not to do that because of editorial styling rules. If there were a _syntactic_ issue, like final punctuation creating havoc with heading links, that would be a different matter.
Author
Owner

@DavidAnson commented on GitHub (May 19, 2020):

This project has a mix of all three categories. It’s slightly opinionated - but it’s also easy to opt out of any rule you don’t agree with.

FWIW, I haven’t used a linter yet where I agreed with every suggestion it made. :)

<!-- gh-comment-id:631089918 --> @DavidAnson commented on GitHub (May 19, 2020): This project has a mix of all three categories. It’s slightly opinionated - but it’s also easy to opt out of any rule you don’t agree with. FWIW, I haven’t used a linter yet where I agreed with every suggestion it made. :)
Author
Owner

@sanmai-NL commented on GitHub (May 22, 2020):

I fully agree that this ought to be solved. @DavidAnson, it's important for a linter to be correct, not just opionated. Opinion is fine, as long as it's based on some authoritative sources. In addition, a linter should provide value in steering towards best practices, not just steering around. When these are parameters requiring manual tuning, the cost-benefit ratio of using this tool is impacted negatively.

I also agree with @PeterConstable that editorial stylistic rules are beyond the purview of a linter for a formal language.

I did not find authoritative sources that reject terminal question marks in headings or titles in general. See e.g. https://www.thepunctuationguide.com/question-mark.html.

For me, it is important to be able to write question marks for FAQ entries, which occur regularly in the educational materials I create.

<!-- gh-comment-id:632604292 --> @sanmai-NL commented on GitHub (May 22, 2020): I fully agree that this ought to be solved. @DavidAnson, it's important for a linter to be correct, not just opionated. Opinion is fine, as long as it's based on some authoritative sources. In addition, a linter should provide value in steering towards best practices, not just steering around. When these are parameters requiring manual tuning, the cost-benefit ratio of using this tool is impacted negatively. I also agree with @PeterConstable that editorial stylistic rules are beyond the purview of a linter for a formal language. I did not find authoritative sources that reject terminal question marks in headings or titles in general. See e.g. https://www.thepunctuationguide.com/question-mark.html. For me, it is important to be able to write question marks for FAQ entries, which occur regularly in the educational materials I create.
Author
Owner

@PeterConstable commented on GitHub (May 22, 2020):

@sanmai-NL : I just discovered that if the question in a heading is italicized—so wrapped in _ ... _—then that keeps this linter from complaining.

However, I still think a linter shouldn't be functioning like a content-language copy editor or proofing tool.

<!-- gh-comment-id:632854382 --> @PeterConstable commented on GitHub (May 22, 2020): @sanmai-NL : I just discovered that if the question in a heading is italicized—so wrapped in \_ ... \_—then that keeps this linter from complaining. However, I still think a linter shouldn't be functioning like a content-language copy editor or proofing tool.
Author
Owner

@DavidAnson commented on GitHub (May 22, 2020):

Thanks everyone for the feedback!

To respond to a couple of points above:

  • This is not a correctness issue; the rule is doing what it says. Rather, we are discussing the preferred default configuration.
  • Regarding whether a linter should report style issues also, I suggest the answer is yes, and point to existing rules for enforcing a consistent list marker (-+*) as well as reasonable list numbering (1, 2, 3). Neither is required for correctness, but both are exactly the kinds of things I look to a linter to highlight.

Thinking about whether or not question marks and exclamation points belong in a heading, I would cite the same resource used above:

Note that headings are not a recommended scenario for either form of punctuation according to that guide. To be fair, it's not called out as being wrong, but none of the examples recommend a question or exclamation as part of a title.

It seems relevant to note that the use of these punctuation marks is so often abused that there are articles about the problem and names for the phenomenon:

Again, that's not to say that it's always inappropriate to use a question mark or exclamation mark in a heading, but it does provide a certain justification that they are frequently misused and therefore that it's probably worth a second look when they show up in this context.

There is no "right" or "wrong" here, and I do strive to make sure the rules are consistent with general practice. This issue has come up enough that I may remove them in a future release, but I did want to explain a bit more about why they're still included today.

<!-- gh-comment-id:632866289 --> @DavidAnson commented on GitHub (May 22, 2020): Thanks everyone for the feedback! To respond to a couple of points above: - This is not a correctness issue; the rule is doing what it says. Rather, we are discussing the preferred default configuration. - Regarding whether a linter should report style issues also, I suggest the answer is yes, and point to existing rules for enforcing a consistent list marker (`-+*`) as well as reasonable list numbering (1, 2, 3). Neither is required for correctness, but both are exactly the kinds of things I look to a linter to highlight. Thinking about whether or not question marks and exclamation points belong in a heading, I would cite the same resource used above: - https://www.thepunctuationguide.com/question-mark.html - https://www.thepunctuationguide.com/exclamation-point.html Note that headings are not a recommended scenario for either form of punctuation according to that guide. To be fair, it's not called out as being wrong, but none of the examples recommend a question or exclamation as part of a title. It seems relevant to note that the use of these punctuation marks is so often abused that there are articles about the problem and names for the phenomenon: - https://amp.theatlantic.com/amp/article/563774/ - https://en.m.wikipedia.org/wiki/Betteridge%27s_law_of_headlines Again, that's not to say that it's always inappropriate to use a question mark or exclamation mark in a heading, but it does provide a certain justification that they are frequently misused and therefore that it's probably worth a second look when they show up in this context. There is no "right" or "wrong" here, and I do strive to make sure the rules are consistent with general practice. This issue has come up enough that I may remove them in a future release, but I did want to explain a bit more about why they're still included today.
Author
Owner

@PeterConstable commented on GitHub (May 22, 2020):

Regarding whether a linter should report style issues also, I suggest the answer is yes, and point to existing rules for enforcing a consistent list marker (-+*) as well as reasonable list numbering (1, 2, 3).

Style enforcement for the markup language is not in question. The issue is about style enforcement in the content language.

Whether or not Betteridge or anybody else with editorial opinions believes that punctuation marks don't belong in headings or titles, there are plenty of content authors that will nonetheless use them in headings or titles. Linting a markup language and proofing/copy editing content are two completely different things and should be handled separately.

<!-- gh-comment-id:632929924 --> @PeterConstable commented on GitHub (May 22, 2020): >Regarding whether a linter should report style issues also, I suggest the answer is yes, and point to existing rules for enforcing a consistent list marker (-+*) as well as reasonable list numbering (1, 2, 3). Style enforcement for the markup language is not in question. The issue is about style enforcement in the content language. Whether or not Betteridge or anybody else with editorial opinions believes that punctuation marks don't belong in headings or titles, there are plenty of content authors that will nonetheless use them in headings or titles. Linting a markup language and proofing/copy editing content are two completely different things and should be handled separately.
Author
Owner

@sanmai-NL commented on GitHub (May 23, 2020):

No authoritative source categorically rejects question marks in headings. Indeed, The Punctuation Guide only confirms its wide applicability, not only as sentence boundary (terminal punctuation), but even within sentences.

¿Cómo abordará las preguntas en español, entonces?

<!-- gh-comment-id:633006555 --> @sanmai-NL commented on GitHub (May 23, 2020): No authoritative source categorically rejects question marks in headings. Indeed, The Punctuation Guide only confirms its wide applicability, not only as sentence boundary (terminal punctuation), but even within sentences. ¿Cómo abordará las preguntas en español, entonces?
Author
Owner

@PeterConstable commented on GitHub (May 23, 2020):

Even if some editorial authority did categorically reject question marks in headings, a tool for enforcing that should be advertised as a tool for enforcing those content requirements, not as a tool for markup-language requirements.

<!-- gh-comment-id:633009959 --> @PeterConstable commented on GitHub (May 23, 2020): Even if some editorial authority _did_ categorically reject question marks in headings, a tool for enforcing that should be advertised as a tool for enforcing those _content_ requirements, not as a tool for markup-language requirements.
Author
Owner

@sanmai-NL commented on GitHub (May 23, 2020):

@PeterConstable I fully agree with your angle. Actually, the whole no-terminal-punctuation should be abolished then.

<!-- gh-comment-id:633081135 --> @sanmai-NL commented on GitHub (May 23, 2020): @PeterConstable I fully agree with your angle. Actually, the whole no-terminal-punctuation should be abolished then.
Author
Owner

@ssbarnea commented on GitHub (Jun 3, 2020):

I am looking forward to get this addressed, is really annoying.

<!-- gh-comment-id:638290473 --> @ssbarnea commented on GitHub (Jun 3, 2020): I am looking forward to get this addressed, is really annoying.
Author
Owner

@DavidAnson commented on GitHub (Jun 3, 2020):

@ssbarnea If this detail is bothering you, you can disable the rule or change the list of punctuation it is looking for. There is no need to wait for an update to the library.

<!-- gh-comment-id:638299393 --> @DavidAnson commented on GitHub (Jun 3, 2020): @ssbarnea If this detail is bothering you, you can disable the rule or change the list of punctuation it is looking for. There is no need to wait for an update to the library.
Author
Owner

@jamescoleuk commented on GitHub (Jun 4, 2020):

David can I just say thank you for maintaining this and engaging as you
have done. 🙏 I remain quite certain the rule is overstepping its bounds
and annoyingly high-lighting something that is 100% not a problem. I'd
still like it to highlight full stops and commas, so it's a useful rule to
me and I don't wish to disable it. But it's your library and I respect your
right to make these decisions. Thanks again.

On Wed, 3 Jun 2020 at 17:12, David Anson notifications@github.com wrote:

@ssbarnea https://github.com/ssbarnea If this detail is bothering you,
you can disable the rule or change the list of punctuation it is looking
for. There is no need to wait for an update to the library.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/DavidAnson/markdownlint/issues/276#issuecomment-638299393,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AKWNOOCFCYXQSEBFXBKXREDRUZY6LANCNFSM4MO4URAA
.

<!-- gh-comment-id:638658043 --> @jamescoleuk commented on GitHub (Jun 4, 2020): David can I just say thank you for maintaining this and engaging as you have done. 🙏 I remain quite certain the rule is overstepping its bounds and annoyingly high-lighting something that is 100% not a problem. I'd still like it to highlight full stops and commas, so it's a useful rule to me and I don't wish to disable it. But it's your library and I respect your right to make these decisions. Thanks again. On Wed, 3 Jun 2020 at 17:12, David Anson <notifications@github.com> wrote: > @ssbarnea <https://github.com/ssbarnea> If this detail is bothering you, > you can disable the rule or change the list of punctuation it is looking > for. There is no need to wait for an update to the library. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/DavidAnson/markdownlint/issues/276#issuecomment-638299393>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AKWNOOCFCYXQSEBFXBKXREDRUZY6LANCNFSM4MO4URAA> > . >
Author
Owner

@yordis commented on GitHub (Nov 8, 2020):

I always find myself using the question mark ? in my headers all the time, as many others https://github.com/aip-dev/google.aip.dev/blob/master/README.md#have-an-idea-for-an-aip

For example, one that I use all the time ## What's next? to direct and help people what to do next.

Personally, I find this rule quite annoying, and I agree about not having multiple sentences in the header, but removing these symbols doesn't make sense to me.

<!-- gh-comment-id:723531224 --> @yordis commented on GitHub (Nov 8, 2020): I always find myself using the question mark `?` in my headers all the time, as many others https://github.com/aip-dev/google.aip.dev/blob/master/README.md#have-an-idea-for-an-aip For example, one that I use all the time `## What's next?` to direct and help people what to do next. Personally, I find this rule quite annoying, and I agree about not having multiple sentences in the header, but removing these symbols doesn't make sense to me.
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#2085
No description provided.