diff --git a/packages/pl-fe/src/components/parsed-content.tsx b/packages/pl-fe/src/components/parsed-content.tsx index 970464a48..9ea15dede 100644 --- a/packages/pl-fe/src/components/parsed-content.tsx +++ b/packages/pl-fe/src/components/parsed-content.tsx @@ -25,10 +25,11 @@ const nodesToText = (nodes: Array): string => const isHostNotVisible = (href: string, nodes: Array): false | string => { try { - const { host } = new URL(href); + let { host } = new URL(href); + host = host.replace(/^www\./, ''); const text = nodesToText(nodes).trim(); - if (new RegExp(`^(https?://)?(www\.)?${host}(/|$)`).test(text)) { + if (new RegExp(`^(https?://)?(www.)?${host}(/|$)`).test(text)) { return false; } else { return host;