DavidAnson / markdownlint

A Node.js style checker and lint tool for Markdown/CommonMark files.
MIT License
4.84k stars 736 forks source link

MD001 fails to detect <hN> tag #1390

Open xuhdev opened 1 month ago

xuhdev commented 1 month ago

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]
DavidAnson commented 1 month ago

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.