Refactor to freeze parser tokens only when custom rules are present (negligable performance improvement).

This commit is contained in:
David Anson 2024-10-11 22:18:51 -07:00
parent a63972a666
commit 5e1b269fa5
4 changed files with 110 additions and 92 deletions

View file

@ -73,7 +73,7 @@ module.exports = {
if (autoLinks.length > 0) {
// Re-parse with correct link/image reference definition handling
const document = params.lines.join("\n");
const tokens = parse(document, undefined, false);
const tokens = parse(document);
for (const token of literalAutolinks(tokens)) {
const range = [
token.startColumn,