mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update MD043 to fix required header checks in middle and last when using special char "*" (#396)
This commit is contained in:
parent
9122b8d935
commit
c6d95cb904
8 changed files with 90 additions and 6 deletions
|
|
@ -3703,8 +3703,11 @@ module.exports = {
|
|||
var actual = levels_1[heading.tag] + " " + content;
|
||||
var expected = getExpected_1();
|
||||
if (expected === "*") {
|
||||
matchAny_1 = true;
|
||||
getExpected_1();
|
||||
var nextExpected = getExpected_1();
|
||||
if (nextExpected.toLowerCase() !== actual.toLowerCase()) {
|
||||
matchAny_1 = true;
|
||||
i_1--;
|
||||
}
|
||||
}
|
||||
else if (expected === "+") {
|
||||
matchAny_1 = true;
|
||||
|
|
@ -3721,8 +3724,10 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
});
|
||||
var extraHeadings = requiredHeadings.length - i_1;
|
||||
if (!hasError_1 &&
|
||||
(i_1 < requiredHeadings.length) &&
|
||||
((extraHeadings > 1) ||
|
||||
((extraHeadings === 1) && (requiredHeadings[i_1] !== "*"))) &&
|
||||
(anyHeadings_1 || !requiredHeadings.every(function (heading) { return heading === "*"; }))) {
|
||||
addErrorContext(onError, params.lines.length, requiredHeadings[i_1]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue