Skip to content

Commit fdd5c84

Browse files
committed
Avoid lookbehind in regexp
Fixes microsoft#141689
1 parent 4bdfc9a commit fdd5c84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extensions/markdown-language-features/src/features/documentLinkProvider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export function stripAngleBrackets(link: string) {
106106
const linkPattern = /(\[((!\[[^\]]*?\]\(\s*)([^\s\(\)]+?)\s*\)\]|(?:\\\]|[^\]])*\])\(\s*)(([^\s\(\)]|\([^\s\(\)]*?\))+)\s*(".*?")?\)/g;
107107
const referenceLinkPattern = /(\[((?:\\\]|[^\]])+)\]\[\s*?)([^\s\]]*?)\]/g;
108108
const definitionPattern = /^([\t ]*\[(?!\^)((?:\\\]|[^\]])+)\]:\s*)([^<]\S*|<[^>]+>)/gm;
109-
const inlineCodePattern = /(?:(?<!`)(`+)(?!`)(?:.+?|.*?(?:(?:\r?\n).+?)*?)(?:\r?\n)?(?<!`)\1(?!`))/g;
109+
const inlineCodePattern = /(?:^|[^`])(`+)(?:.+?|.*?(?:(?:\r?\n).+?)*?)(?:\r?\n)?\1(?:$|[^`])/gm;
110110

111111
interface CodeInDocument {
112112
/**

0 commit comments

Comments
 (0)