mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Fix array indexing for markdownlint-disable-next-line when front matter is present.
This commit is contained in:
parent
7a76f1d22d
commit
5253669495
3 changed files with 26 additions and 4 deletions
|
|
@ -403,11 +403,12 @@ function getEnabledRulesPerLineNumber(
|
|||
// eslint-disable-next-line jsdoc/require-jsdoc
|
||||
function disableNextLine(action, parameter, lineNumber) {
|
||||
if (action === "DISABLE-NEXT-LINE") {
|
||||
enabledRulesPerLineNumber[lineNumber + 1] =
|
||||
const nextLineNumber = frontMatterLines.length + lineNumber + 1;
|
||||
enabledRulesPerLineNumber[nextLineNumber] =
|
||||
applyEnableDisable(
|
||||
action,
|
||||
parameter,
|
||||
enabledRulesPerLineNumber[lineNumber + 1] || {}
|
||||
enabledRulesPerLineNumber[nextLineNumber] || {}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue