mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Fix possible crash in MD005/list-indent, reporting issue with MD029/ol-prefix.
This commit is contained in:
parent
320acfd7cc
commit
678597485b
3 changed files with 14 additions and 8 deletions
|
@ -19,6 +19,7 @@ module.exports = {
|
|||
list.items.forEach((item) => {
|
||||
const { line, lineNumber } = item;
|
||||
const actualIndent = indentFor(item);
|
||||
let match = null;
|
||||
if (list.unordered) {
|
||||
addErrorDetailIf(
|
||||
onError,
|
||||
|
@ -30,8 +31,7 @@ module.exports = {
|
|||
rangeFromRegExp(line, listItemMarkerRe)
|
||||
// No fixInfo; MD007 handles this scenario better
|
||||
);
|
||||
} else {
|
||||
const match = orderedListItemMarkerRe.exec(line);
|
||||
} else if ((match = orderedListItemMarkerRe.exec(line))) {
|
||||
actualEnd = match[0].length;
|
||||
expectedEnd = expectedEnd || actualEnd;
|
||||
const markerLength = match[1].length + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue