updated htmlLinkRegex to allow for attributes before the href in anchor tags

This commit is contained in:
dylan 2025-12-25 17:27:15 +00:00
parent 9640a37f4a
commit e99989c268

View file

@ -11,7 +11,7 @@ export function markdownLinkRegex(url) {
export function htmlLinkRegex(url) {
return new RegExp(
`(<a href="https:\\/\\/${url.replaceAll('.', '\\.')}[^"]*">).*?(<\\/a>)`,
`(<a [^>]*href="https:\\/\\/${url.replaceAll('.', '\\.')}[^"]*"[^>]*>).*?(<\\/a>)`,
'i',
)
}