[GH-ISSUE #94] MD003/header-style: bug, setext followed by atx flagged as error with setext_with_atx setting. #1925

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

Originally created by @fbartho on GitHub (Nov 17, 2017).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/94

If you have a markdown file as follows:

Title
=====

## Heading

Some stuff

And a config of:

  "markdownlint": {
    "header-style": { "style": "setext_with_atx" },
  }

You get the following error

file: 'file:///Users/fbartho/Code/MD003ErrorExample.md'
severity: 'Warning'
message: 'MD003/header-style: Header style [Expected: setext; Actual: atx]'
at: '4,1'
source: 'markdownlint'

It appears to be mis-parsing setext_with_atx as simply setext

Originally created by @fbartho on GitHub (Nov 17, 2017). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/94 If you have a markdown file as follows: ```markdown Title ===== ## Heading Some stuff ``` And a config of: ```json "markdownlint": { "header-style": { "style": "setext_with_atx" }, } ``` You get the following error ``` file: 'file:///Users/fbartho/Code/MD003ErrorExample.md' severity: 'Warning' message: 'MD003/header-style: Header style [Expected: setext; Actual: atx]' at: '4,1' source: 'markdownlint' ``` It appears to be mis-parsing `setext_with_atx` as simply `setext`
kerem 2026-03-07 20:02:49 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Nov 17, 2017):

Per the documentation, setext_with_atx uses setext style for header levels 1 and 2 and atx style for header levels 3 and above. Therefore, the message above seems correct.

https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md003

<!-- gh-comment-id:345374049 --> @DavidAnson commented on GitHub (Nov 17, 2017): Per the documentation, `setext_with_atx` uses `setext` style for header levels 1 and 2 and `atx` style for header levels 3 and above. Therefore, the message above seems correct. https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md003
Author
Owner

@fbartho commented on GitHub (Nov 17, 2017):

Ahh! I read the option name directly, and didn't see in the doc-page that it was specifically for levels 3 & above. I thought it was for any mix & match. Thanks!

Feel free to close this ticket, or turn it into a documentation improvement request? My question is resolved.

<!-- gh-comment-id:345379706 --> @fbartho commented on GitHub (Nov 17, 2017): Ahh! I read the option name directly, and didn't see in the doc-page that it was specifically for levels 3 & above. I thought it was for any mix & match. Thanks! Feel free to close this ticket, or turn it into a documentation improvement request? My question is resolved.
Author
Owner

@DavidAnson commented on GitHub (Nov 17, 2017):

Because this is the first time this question has come up, I will close it for now. If someone else asks, I will make an effort to improve the documentation. Thanks for the quick reply!

<!-- gh-comment-id:345388589 --> @DavidAnson commented on GitHub (Nov 17, 2017): Because this is the first time this question has come up, I will close it for now. If someone else asks, I will make an effort to improve the documentation. Thanks for the quick reply!
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#1925
No description provided.