[GH-ISSUE #1026] MD036 triggered right before a header #2444

Closed
opened 2026-03-07 20:07:49 +03:00 by kerem · 1 comment
Owner

Originally created by @fharper on GitHub (Oct 30, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1026

In this example

# Title

I have some text here.

_Note: something here_

## Another section

Other text here

The italic note will trigger the MD036 rule. I think it should not be triggered if there is a title immediately after, which would mean with no doubt that the emphasis isn't used as a title, since there is no parapgrah of text after it. WDYT?

Originally created by @fharper on GitHub (Oct 30, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1026 In this example ``` # Title I have some text here. _Note: something here_ ## Another section Other text here ``` The italic note will trigger the MD036 rule. I think it should not be triggered if there is a title immediately after, which would mean with no doubt that the emphasis isn't used as a title, since there is no parapgrah of text after it. WDYT?
kerem 2026-03-07 20:07:49 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Oct 31, 2023):

It's valid to have a heading that isn't followed by paragraph text – perhaps there is another heading or a block quote or the end of the file, etc.. I do not think the heuristic proposed is super reliable, and I'm reluctant to try to put too much intelligence into this rule. I think it is correct to warn in this case and clear why it did so. If this is a pattern you use frequently, you may want to disable the rule for that file or project.

<!-- gh-comment-id:1786251478 --> @DavidAnson commented on GitHub (Oct 31, 2023): It's valid to have a heading that isn't followed by paragraph text – perhaps there is another heading or a block quote or the end of the file, etc.. I do not think the heuristic proposed is super reliable, and I'm reluctant to try to put too much intelligence into this rule. I think it is correct to warn in this case and clear why it did so. If this is a pattern you use frequently, you may want to disable the rule for that file or project.
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#2444
No description provided.