From ceaa7f6f8919a029d20a970c8999a39b3d85701f Mon Sep 17 00:00:00 2001 From: dylan Date: Thu, 25 Dec 2025 18:07:09 +0000 Subject: [PATCH] updated htmlLinkRegex to allow for optional attributes in anchor tags --- utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils.js b/utils.js index fe475fa..be66013 100644 --- a/utils.js +++ b/utils.js @@ -10,8 +10,9 @@ export function markdownLinkRegex(url) { } export function htmlLinkRegex(url) { + const escapedUrl = url.replaceAll('.', '\\.') return new RegExp( - `(]*href="https:\\/\\/${url.replaceAll('.', '\\.')}[^"]*"[^>]*>).*?(<\\/a>)`, + `(]+href=["']https?:\\/\\/${escapedUrl}[^"']*["'][^>]*>).*?(<\\/a>)`, 'i', ) }