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', ) }