[GH-ISSUE #1390] MD001 fails to detect <hN> tag #2521

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

Originally created by @xuhdev on GitHub (Oct 23, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1390

markdownlint-cli2 reports error for the following markdown file:

# H1

<h2>H2</h2>

### H3

a.md:5 MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]
Originally created by @xuhdev on GitHub (Oct 23, 2024). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1390 markdownlint-cli2 reports error for the following markdown file: ```md # H1 <h2>H2</h2> ### H3 ``` ``` a.md:5 MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3] ```
kerem 2026-03-07 20:08:33 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Oct 23, 2024):

This rule (along with almost all the rules) does not attempt to reconcile Markdown structure with embedded HTML elements. (In fact, using HTML is discouraged per rule MD033.) There are many ways a document could alternate between Markdown and HTML and it is not a goal of this tool to try to make sense of all that.

<!-- gh-comment-id:2430669778 --> @DavidAnson commented on GitHub (Oct 23, 2024): This rule (along with almost all the rules) does not attempt to reconcile Markdown structure with embedded HTML elements. (In fact, using HTML is discouraged per rule MD033.) There are many ways a document could alternate between Markdown and HTML and it is not a goal of this tool to try to make sense of all that.
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#2521
No description provided.