Don't parse checkboxes are links in markdown (#150914)

Fixes #150672
This commit is contained in:
Matt Bierner
2022-05-31 14:57:32 -07:00
committed by GitHub
parent 3c6fdedd0e
commit e6fff5ecff
4 changed files with 62 additions and 0 deletions

View File

@@ -353,6 +353,12 @@ export class MdLinkProvider implements vscode.DocumentLinkProvider {
reference = match[5];
const offset = ((match.index ?? 0) + match[1].length) + 1;
linkStart = document.positionAt(offset);
const line = document.lineAt(linkStart.line);
// See if link looks like a checkbox
const checkboxMatch = line.text.match(/^\s*\-\s*\[x\]/i);
if (checkboxMatch && linkStart.character <= checkboxMatch[0].length) {
continue;
}
linkEnd = document.positionAt(offset + reference.length);
} else {
continue;