diff --git a/src/static/js/components.js b/src/static/js/components.js index 060d09f..3c9c97c 100644 --- a/src/static/js/components.js +++ b/src/static/js/components.js @@ -788,8 +788,8 @@ const UI = { const buildPill = (src, fallbackName) => { const displayName = src ? (src.name || fallbackName) : fallbackName; const url = (src && src.url) || ''; - const isTelegram = /^https?:\/\/t\.me\//i.test(url); - const label = isTelegram ? displayName + ' (Telegram-Link)' : displayName; + const tgMatch = url.match(/^https?:\/\/t\.me\/([^\/?#]+)/i); + const label = tgMatch ? displayName + ' (t.me/' + tgMatch[1] + ')' : displayName; const esc = this.escape(label); const titleEsc = this.escape(displayName); if (src && src.url) {