How can I turn off "MD024/no-duplicate-heading/no-duplicate-header: Multiple headings with the same content" error in Markdown file?
Asked Answered
W

2

5

I have several sections with the same name but inside different parent sections:

# Page title

## Section A

### Examples

## Section B

### Examples

markdownlint linter gives me this warning:

MD024/no-duplicate-heading/no-duplicate-header: Multiple headings with the same content.

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

How can I turn off this warning and still be warned when I have several sections with the same name on the same level, like so:

# Page title

## Section A

## Section A

?

Wellintentioned answered 1/10, 2023 at 2:17 Comment(0)
W
5

Create .markdownlint.json file in the root folder and add this JSON:

{
  "no-duplicate-heading": {
    "siblings_only": true
  }
}
Wellintentioned answered 1/10, 2023 at 2:17 Comment(0)
M
1

This has been changed in a more recent version of markdownlint. The alias for heading called header was removed and the parameter changed.

  "no-duplicate-heading": {
    "siblings_only": true
  },
Mecham answered 29/1 at 14:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.