Update helpers.codeBlockAndSpanRanges to use "Array.forEach" instead of "for of Array.entries()" to work around seeming Webpack transpilation issue affecting markdownlint-browser.js (fixes #525).

This commit is contained in:
David Anson 2022-05-13 21:39:22 -07:00
parent 877ede7735
commit cf26cc7c92
2 changed files with 4 additions and 5 deletions

View file

@ -590,13 +590,13 @@ module.exports.codeBlockAndSpanRanges = (params, lineMetadata) => {
tokenLines.join("\n"),
(code, lineIndex, columnIndex) => {
const codeLines = code.split(newLineRe);
for (const [ i, line ] of codeLines.entries()) {
codeLines.forEach((line, i) => {
exclusions.push([
token.lineNumber - 1 + lineIndex + i,
i ? 0 : columnIndex,
line.length
]);
}
});
}
);
}