From f03d870bcdcdce18a2871757460e3229458dba63 Mon Sep 17 00:00:00 2001 From: Szymon Kaliski Date: Thu, 11 Jan 2024 11:23:24 -0800 Subject: [PATCH] adjust a comment --- addons/addon-web-links/src/WebLinkProvider.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/addon-web-links/src/WebLinkProvider.ts b/addons/addon-web-links/src/WebLinkProvider.ts index 1000b788..713f9c23 100644 --- a/addons/addon-web-links/src/WebLinkProvider.ts +++ b/addons/addon-web-links/src/WebLinkProvider.ts @@ -68,12 +68,8 @@ export class LinkComputer { // check via URL if the matched text would form a proper url // NOTE: This outsources the ugly url parsing to the browser. - // To avoid surprising auto expansion from URL we additionally - // check afterwards if the provided string resembles the parsed - // one close enough: - // - decodeURI decode path segement back to byte repr - // to detect unicode auto conversion correctly - // - append / also match domain urls w'o any path notion + // we check if the provided string resembles the URL-parsed one + // up to the end of the domain name (ignoring path and params) try { const url = new URL(text); if (!text.startsWith(baseUrlString(url))) {