Update MD001/heading-increment to support front matter title as the first heading of the page.

This commit is contained in:
Alexandre Feblot 2025-06-07 04:54:23 +02:00 committed by GitHub
parent a366f80873
commit 1b6839bff0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 317 additions and 16 deletions

View file

@ -16178,6 +16178,87 @@ Generated by [AVA](https://avajs.dev).
`,
}
## heading_increment-alt_title_level3_bad.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Expected: h2; Actual: h3',
errorRange: null,
fixInfo: null,
lineNumber: 5,
ruleDescription: 'Heading levels should only increment by one level at a time',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md',
ruleNames: [
'MD001',
'heading-increment',
],
},
],
fixed: `---␊
alternate = heading_increment-alt_title_level3_bad␊
---␊
### level 3 {MD001}␊
<!-- markdownlint-configure-file {␊
"heading-increment": {␊
"front_matter_title": "^\\\\s*alternate\\\\s*="␊
},␊
"first-line-heading": {␊
"front_matter_title": "^\\\\s*alternate\\\\s*="␊
}␊
} -->␊
`,
}
## heading_increment-title_level2_good.md
> Snapshot 1
{
errors: [],
fixed: `---␊
title: heading_increment-title_level2_good␊
---␊
## level 2␊
### level 3␊
`,
}
## heading_increment-title_level3_bad.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Expected: h2; Actual: h3',
errorRange: null,
fixInfo: null,
lineNumber: 5,
ruleDescription: 'Heading levels should only increment by one level at a time',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md001.md',
ruleNames: [
'MD001',
'heading-increment',
],
},
],
fixed: `---␊
title: heading_increment-title_level3_good␊
---␊
### level 3 {MD001}␊
`,
}
## heading_multiple_toplevel.md
> Snapshot 1