From 019d87e5c7793006f0b61d80f01f719625a40fd3 Mon Sep 17 00:00:00 2001 From: David Kincaid Date: Wed, 17 Apr 2024 09:45:54 -0700 Subject: [PATCH] Prevent document links from accidentally being resolved to your entire document (#639) --- src/providers/document_link.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/document_link.ts b/src/providers/document_link.ts index f5e23a8..bffb0c9 100644 --- a/src/providers/document_link.ts +++ b/src/providers/document_link.ts @@ -62,7 +62,7 @@ export class GDDocumentLinkProvider implements DocumentLinkProvider { links.push(link); } } - for (const match of text.matchAll(/res:\/\/[^"^']*/g)) { + for (const match of text.matchAll(/res:\/\/([^"'\n]*)/g)) { const r = this.create_range(document, match); const uri = await convert_resource_path_to_uri(match[0]); if (uri instanceof Uri) {