added htmlLinkRegex function to utils.js
This commit is contained in:
parent
b9a6869355
commit
14cbcede69
1 changed files with 7 additions and 0 deletions
7
utils.js
7
utils.js
|
|
@ -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) {
|
||||
return text
|
||||
.replaceAll('`', '\\`')
|
||||
|
|
|
|||
Loading…
Reference in a new issue