[GH-ISSUE #1416] first-line-h1 insufficient replacement for first-heading-h1 #681

Closed
opened 2026-03-03 01:29:00 +03:00 by kerem · 2 comments
Owner

Originally created by @bbodenmiller on GitHub (Nov 14, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1416

There is times that the first line is not desired as a header (e.g. a TOC) but that we want to ensure the first header (which follows TOC) is in fact H1. This does not appear possible with first-line-h1

Originally created by @bbodenmiller on GitHub (Nov 14, 2024). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1416 There is times that the first line is not desired as a header (e.g. a TOC) but that we want to ensure the first header (which follows TOC) is in fact H1. This does not appear possible with `first-line-h1`
kerem 2026-03-03 01:29:00 +03:00
Author
Owner

@DavidAnson commented on GitHub (Nov 14, 2024):

Agreed. I'm not sure the behavior you describe is entirely in keeping with the intent of MD041/first-line-heading, anyway.

However, it could be a reasonable thing for MD001/heading-increment to enforce, assuming it got a new parameter starting_level which would be set to 1 in your case.

https://github.com/DavidAnson/markdownlint/blob/main/doc/md001.md

<!-- gh-comment-id:2475308178 --> @DavidAnson commented on GitHub (Nov 14, 2024): Agreed. I'm not sure the behavior you describe is entirely in keeping with the intent of MD041/first-line-heading, anyway. However, it could be a reasonable thing for MD001/heading-increment to enforce, assuming it got a new parameter starting_level which would be set to 1 in your case. https://github.com/DavidAnson/markdownlint/blob/main/doc/md001.md
Author
Owner

@bbodenmiller commented on GitHub (Nov 14, 2024):

@DavidAnson starting_level option on MD001/heading-increment would certainly work!

<!-- gh-comment-id:2475402496 --> @bbodenmiller commented on GitHub (Nov 14, 2024): @DavidAnson starting_level option on MD001/heading-increment would certainly work!
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#681
No description provided.