markdownlint icon indicating copy to clipboard operation
markdownlint copied to clipboard

Rule MD024 should be refined [to allow heading duplication for non-siblings]

Open bfzhao opened this issue 8 years ago • 4 comments

It is reasonable to have rule MD024 to report any title conflict, but it makes sense only when those titles have the same parent title. Below case is very common and should not be reported as an issue:

# cast 1
## RCA
## RCA -----> should report here
## Action List 
# case 2
## RCA -----> should not report here
## Action List 

bfzhao avatar Jul 17 '18 02:07 bfzhao

Although this conflicts with the rationale given in the rule description (https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md024---multiple-headings-with-the-same-content), it seems reasonable as an option.

DavidAnson avatar Jul 17 '18 02:07 DavidAnson

Here’s a corresponding issue/commit from the Ruby implementation: https://github.com/markdownlint/markdownlint/issues/175

I prefer a parameter name like only_siblings and will probably support both for compatibility.

DavidAnson avatar Jul 17 '18 16:07 DavidAnson

Add this to your setting.json if using vscode:

"markdownlint.config": {
        "MD024": false
}

Coding-Rod avatar Jul 27 '23 15:07 Coding-Rod

I know it can be ignored, but this rule actually makes sense within the same scope. I think that this rule should be: a) either enhanced to check only within scope b) defaulted to false. And a new rule to check same-level conflicts only could be added

lveillard avatar Nov 13 '23 19:11 lveillard