Fixing false positive ref link being detected

This commit is contained in:
Matt Bierner
2022-03-31 19:09:14 -07:00
parent c39d09a4c0
commit 8b7086afdb
4 changed files with 23 additions and 3 deletions

View File

@@ -157,7 +157,7 @@ const linkPattern = /(\[((!\[[^\]]*?\]\(\s*)([^\s\(\)]+?)\s*\)\]|(?:\\\]|[^\]])*
/**
* Matches `[text][ref]`
*/
const referenceLinkPattern = /(?:(\[((?:\\\]|[^\]])+)\]\[\s*?)([^\s\]]*?)\]|\[\s*?([^\s\]]*?)\])(?!\:)/g;
const referenceLinkPattern = /(?:(\[((?:\\\]|[^\]])+)\]\[\s*?)([^\s\]]*?)\]|\[\s*?([^\s\]]*?)\])(?![\:\(])/g;
/**
* Matches `[text]: link`