added htmlLinkRegex function to utils.js

This commit is contained in:
dylan 2025-12-25 17:23:40 +00:00
parent b9a6869355
commit 14cbcede69

View file

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