mirror of
https://github.com/getmaxun/maxun.git
synced 2026-10-17 04:30:39 +08:00
fix(document): apply the email boundary to all link patterns
This commit is contained in:
@@ -1782,7 +1782,7 @@ export class DocumentInterpreter {
|
||||
// appear as visible text — and those are usually written without a scheme. Match
|
||||
// three shapes: full http(s) URLs, "www."-prefixed hosts, and bare domains with a
|
||||
// recognizable TLD. The last two get "https://" prepended so the output is usable.
|
||||
const urlPattern = /(?:https?:\/\/|www\.)[^\s<>"')\]]+|(?<![@\w.-])(?:[a-z0-9-]+\.)+(?:com|org|net|io|dev|ai|app|co|edu|gov|us|info)\b(?!\.[a-z])(?:\/[^\s<>"')\]]*)?/gi;
|
||||
const urlPattern = /(?<![@\w.-])(?:(?:https?:\/\/|www\.)[^\s<>"')\]]+|(?:[a-z0-9-]+\.)+(?:com|org|net|io|dev|ai|app|co|edu|gov|us|info)\b(?!\.[a-z])(?:\/[^\s<>"')\]]*)?)/gi;
|
||||
const raw = text.match(urlPattern) || [];
|
||||
const htmlLinks = sourceHtml
|
||||
? Array.from(sourceHtml.matchAll(/href\s*=\s*["']([^"']+)["']/gi))
|
||||
|
||||
Reference in New Issue
Block a user