From 62afa41f8302c1d36e17eb2cce6a929dc156fa62 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 24 Jul 2017 10:14:33 +0900 Subject: [PATCH] FIX: Exclude `www` in topic map links. https://meta.discourse.org/t/topic-popular-links-panel-domain-extraction-doesnt-handle-country-tlds/60156/38?u=tgxworld --- app/assets/javascripts/discourse/widgets/topic-map.js.es6 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/widgets/topic-map.js.es6 b/app/assets/javascripts/discourse/widgets/topic-map.js.es6 index 7d4c89c0b39..c489eb7ec27 100644 --- a/app/assets/javascripts/discourse/widgets/topic-map.js.es6 +++ b/app/assets/javascripts/discourse/widgets/topic-map.js.es6 @@ -160,7 +160,8 @@ createWidget('topic-map-expanded', { const domain = l.domain; if (domain && domain.length) { const s = domain.split('.'); - host = h('span.domain', s[s.length-2] + "." + s[s.length-1]); + if (s[0] === 'www') s.shift(); + host = h('span.domain', s.join('.')); } }