Update MD011/no-reversed-links to avoid more nested paren scenarios (fixes #572).

This commit is contained in:
David Anson 2022-10-16 22:16:51 -07:00
parent 56f379b0fc
commit c333976a44
5 changed files with 69 additions and 25 deletions

View file

@ -6,7 +6,7 @@ const { addError, forEachLine, withinAnyRange } = require("../helpers");
const { codeBlockAndSpanRanges, lineMetadata } = require("./cache");
const reversedLinkRe =
/(^|[^\\])\(([^)]+)\)\[([^\]^][^\]]*)](?!\()/g;
/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)](?!\()/g;
module.exports = {
"names": [ "MD011", "no-reversed-links" ],
@ -30,7 +30,7 @@ module.exports = {
onError,
lineIndex + 1,
reversedLink.slice(preChar.length),
null,
undefined,
[ index + 1, length ],
{
"editColumn": index + 1,