MD002 rule reports inconsistent error
See original GitHub issueI am using a static site generator where I have frontmatter yaml like this:
---
id: index
title: Title of my page
---
The title
is converted into H1 when the html page is created. So, in my case I don’t need the first heading in the markdown to be a H1. That’s why I’ve configured the following rules:
{
"default": true,
"MD002": { "level": 2 }
"MD041": false
}
This seems to be working fine. If the very first heading in the content starts with anything other than H2, then I get the following error message:
../docs/index.md: 7: MD002/first-heading-h1/first-header-h1 First heading should be a top level heading [Expected: h2; Actual: h1]
../docs/index.md: 7: MD002/first-heading-h1/first-header-h1 First heading should be a top level heading [Expected: h2; Actual: h3]
I believe I am getting the right behaviour (or at least what I expect), but the error message is slightly conflicting/confusing. At the beginning the error says first-heading-h1 but later it says h2 is expected.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Markdownlint Rules
Note: MD002 has been deprecated and is disabled by default. ... This rule is triggered when different heading styles (atx, setext, and 'closed'...
Read more >Error-Product does not exist in /n/scwm/adhu - SAP Community
When i am performing /n/scwm/adhu i am getting the error "Product does not exist--Message no. /SCWM/MD002" Please advice. Thanks.
Read more >markdownlint/README.md - UNPKG
66, * **[MD005](doc/Rules.md#md005)** *list-indent* - Inconsistent ... mode, all errors that occur on each line are reported (other versions report only.
Read more >Standardize Markdown via markdownlint in CE docs - GitLab
MD002 (first-heading-h1/first-header-h1) - First heading should be ... MD005 (list-indent) - Inconsistent indentation for list items at the ...
Read more >doc/Rules.md · Gitee 极速下载/markdownlint - Gitee.com
MD002 - First heading should be a top level heading ... This rule is triggered when different heading styles (atx, setext, and 'closed'...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After more thought, I’m leaning toward: MD002 -> first-heading-level MD041 -> first-line-heading
Not yet.