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

@ -23,7 +23,7 @@ module.exports = {
[ "atxHeadingText", "setextHeadingText" ]
);
for (const heading of headings) {
const { endLine, startColumn, text } = heading;
const { endColumn, endLine, text } = heading;
const match = trailingPunctuationRe.exec(text);
if (
match &&
@ -31,8 +31,8 @@ module.exports = {
!endOfLineGemojiCodeRe.test(text)
) {
const fullMatch = match[0];
const column = startColumn + match.index;
const length = fullMatch.length;
const column = endColumn - length;
addError(
onError,
endLine,