diff --git a/server/src/workflow-management/classes/DocumentInterpreter.ts b/server/src/workflow-management/classes/DocumentInterpreter.ts index c35c5262..6d47ca72 100644 --- a/server/src/workflow-management/classes/DocumentInterpreter.ts +++ b/server/src/workflow-management/classes/DocumentInterpreter.ts @@ -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<>"')\]]+|(?"')\]]*)?/gi; + const urlPattern = /(?"')\]]+|(?:[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))