diff --git a/app/components/TextParser/TextParser.tsx b/app/components/TextParser/TextParser.tsx index 0573144..9cbdf4c 100644 --- a/app/components/TextParser/TextParser.tsx +++ b/app/components/TextParser/TextParser.tsx @@ -46,10 +46,11 @@ export function TextParser(props: TextParserProps) { { pattern: [ /(https?:\/\/[^\s]+)/g, - /\b(?:https?:\/\/)?(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?:\/[^\s]*)?/g + /\b(?:https?:\/\/)?(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?:\/[\w\-\.\/\?&#=%]*)?/g ], render: (match: string) => { - let domainZone = match.split('.').pop() || ''; + let domain = match.replace(/https?:\/\//, '').split('/')[0]; + let domainZone = domain.split('.').pop() || ''; domainZone = domainZone.split('/')[0]; if(!ALLOWED_DOMAINS_ZONES.includes(domainZone)) { return <>{match};