mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Fix possible exceptions due to addError's range/editColumn out of range, update test-extra to use test.serial() for better progress.
This commit is contained in:
parent
e7d3708056
commit
9b5f6a28f9
8 changed files with 19 additions and 18 deletions
|
|
@ -23,8 +23,7 @@ module.exports = {
|
|||
for (const listItemPrefix of listItemPrefixes) {
|
||||
const lineNumber = listItemPrefix.startLine;
|
||||
const actualIndent = listItemPrefix.startColumn - 1;
|
||||
const markerLength = listItemPrefix.text.trim().length;
|
||||
const range = [ 1, listItemPrefix.startColumn + markerLength ];
|
||||
const range = [ 1, listItemPrefix.endColumn - 1 ];
|
||||
if (list.type === "listUnordered") {
|
||||
addErrorDetailIf(
|
||||
onError,
|
||||
|
|
@ -37,7 +36,8 @@ module.exports = {
|
|||
// No fixInfo; MD007 handles this scenario better
|
||||
);
|
||||
} else {
|
||||
const actualEnd = range[1] - 1;
|
||||
const markerLength = listItemPrefix.text.trim().length;
|
||||
const actualEnd = listItemPrefix.startColumn + markerLength - 1;
|
||||
expectedEnd = expectedEnd || actualEnd;
|
||||
if ((expectedIndent !== actualIndent) || endMatching) {
|
||||
if (expectedEnd === actualEnd) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue