Support definition links with spaces

For #136073
This commit is contained in:
Matt Bierner
2021-11-01 09:22:48 -07:00
parent f145c79a93
commit a9bc0553f7
3 changed files with 37 additions and 17 deletions

View File

@@ -139,11 +139,22 @@ suite('markdown.DocumentLinkProvider', () => {
}
});
// #107471
test('Should not consider link references starting with ^ character valid', () => {
test('Should not consider link references starting with ^ character valid (#107471)', () => {
const links = getLinksForFile('[^reference]: https://example.com');
assert.strictEqual(links.length, 0);
});
test('Should find definitions links with spaces in angle brackets (#136073)', () => {
const links = getLinksForFile([
'[a]: <b c>',
'[b]: <cd>',
].join('\n'));
assert.strictEqual(links.length, 2);
const [link1, link2] = links;
assertRangeEqual(link1.range, new vscode.Range(0, 6, 0, 9));
assertRangeEqual(link2.range, new vscode.Range(1, 6, 1, 8));
});
});