diff --git a/src/utils/dom.ts b/src/utils/dom.ts index b408618..4b14bfe 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -117,11 +117,12 @@ export const parseTextContent = ( return word; } firstLink = firstLink || url.href; + const prettierWithoutSlash = url.pathname === '/'; return elem('a', { href: url.href, target: '_blank', rel: 'noopener noreferrer' - }, url.href.slice(url.protocol.length + 2)); + }, url.href.slice(url.protocol.length + 2, prettierWithoutSlash ? -1 : undefined)); } catch (err) { return word; }