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:
David Anson 2023-12-31 21:51:34 -08:00
parent e7d3708056
commit 9b5f6a28f9
8 changed files with 19 additions and 18 deletions

View file

@ -30,7 +30,7 @@ module.exports = {
unorderedListTypes
);
for (const token of tokens) {
const { parent, startColumn, startLine, type } = token;
const { endColumn, parent, startColumn, startLine, type } = token;
if (type === "blockQuotePrefix") {
lastBlockQuotePrefix = token;
} else if (type === "listUnordered") {
@ -63,7 +63,7 @@ module.exports = {
(lastBlockQuotePrefix.endColumn - 1) :
0;
const actualIndent = startColumn - 1 - blockQuoteAdjustment;
const range = [ 1, startColumn + 1 ];
const range = [ 1, endColumn - 1 ];
const fixInfo = {
"editColumn": startColumn - actualIndent,
"deleteCount": Math.max(actualIndent - expectedIndent, 0),