Update MD041/first-line-heading to add an allow_preamble parameter (fixes #1416).

This commit is contained in:
David Anson 2025-03-22 16:15:59 -07:00
parent c061888937
commit 62dc79864d
17 changed files with 538 additions and 163 deletions

View file

@ -367,20 +367,32 @@ for (const rule of rules) {
break;
case "MD025":
case "MD041":
scheme.properties = {
"level": {
"description": "Heading level",
"type": "integer",
"minimum": 1,
"maximum": 6,
"default": 1
},
"front_matter_title": {
"description": "RegExp for matching title in front matter",
"type": "string",
"default": "^\\s*title\\s*[:=]"
}
};
{
const md041Properties = (ruleName === "MD041") ?
{
"allow_preamble": {
"description": "Allow content before first heading",
"type": "boolean",
"default": false
}
} :
{};
scheme.properties = {
...md041Properties,
"front_matter_title": {
"description": "RegExp for matching title in front matter",
"type": "string",
"default": "^\\s*title\\s*[:=]"
},
"level": {
"description": "Heading level",
"type": "integer",
"minimum": 1,
"maximum": 6,
"default": 1
}
};
}
break;
case "MD043":
scheme.properties = {