mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
[markdown] Ignore brackets inside link text (#151610)
* 🔨 Allow texts in bracket pairs inside link titles; [text](link) Signed-off-by: GitHub <noreply@github.com> * 🔨 Allow texts in bracket pairs inside link titles; [text](<link>) Signed-off-by: GitHub <noreply@github.com> * ⚗️ Add tests to verify link titles can include bracket pairs Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
@@ -101,6 +101,21 @@ suite('markdown.DocumentLinkProvider', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('Should ignore texts in brackets inside link title (#150921)', async () => {
|
||||
{
|
||||
const links = await getLinksForFile('[some [inner bracket pairs] in title](<link>)');
|
||||
assertLinksEqual(links, [
|
||||
new vscode.Range(0, 39, 0, 43),
|
||||
]);
|
||||
}
|
||||
{
|
||||
const links = await getLinksForFile('[some [inner bracket pairs] in title](link)');
|
||||
assertLinksEqual(links, [
|
||||
new vscode.Range(0, 38, 0, 42)
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
test('Should handle two links without space', async () => {
|
||||
const links = await getLinksForFile('a ([test](test)[test2](test2)) c');
|
||||
assertLinksEqual(links, [
|
||||
|
||||
Reference in New Issue
Block a user