mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Don't treat escaped markdown reference links as links (#149407)
Fixes #149406 Make sure that escaping the leading `[` of a reference link means it is not considered a link - Picks up new grammar with fixes - Updates our document link provider to also not consider these as link
This commit is contained in:
@@ -172,6 +172,16 @@ suite('markdown.DocumentLinkProvider', () => {
|
||||
assert.strictEqual(links.length, 0);
|
||||
});
|
||||
|
||||
test('Should not include reference links with escaped leading brackets', async () => {
|
||||
const links = await getLinksForFile(joinLines(
|
||||
`\\[bad link][good]`,
|
||||
`\\[good]`,
|
||||
`[good]: http://example.com`,
|
||||
));
|
||||
assert.strictEqual(links.length, 1);
|
||||
assertRangeEqual(links[0].range, new vscode.Range(2, 8, 2, 26)); // Should only find the definition
|
||||
});
|
||||
|
||||
test('Should not consider links in code fenced with backticks', async () => {
|
||||
const links = await getLinksForFile(joinLines(
|
||||
'```',
|
||||
|
||||
Reference in New Issue
Block a user