From 7740822918f83e948dc11944698862b9ebfe34fc Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 31 Dec 2025 00:19:02 +0000 Subject: [PATCH] updated regex to match service by data-service attribute in html anchor tags --- utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.js b/utils.js index 5a1dfb2..3be0f9a 100644 --- a/utils.js +++ b/utils.js @@ -6,11 +6,11 @@ import sanitizeHtml from 'sanitize-html' // helper functions // ======================================================================== -// regex to match service name within an html anchor tag +// regex to match service by data-service attribute within an html anchor tag // used when linkFormat is 'html' in config.js export function htmlServiceLinkRegex(serviceName) { return new RegExp( - `(]+href=["'][^"']*["'][^>]*>)${serviceName}(<\\/a>)`, + `(]*data-service=["']${serviceName}["'][^>]*>)([^<]*)(<\\/a>)`, 'i', ) }