question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MD002 rule reports inconsistent error

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidAnsoncommented, Mar 9, 2019

After more thought, I’m leaning toward: MD002 -> first-heading-level MD041 -> first-line-heading

0reactions
DavidAnsoncommented, Mar 12, 2019

Not yet.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found