mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 08:46:30 +08:00
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
This commit is contained in:
parent
1797994a63
commit
62afa41f83
|
@ -160,7 +160,8 @@ createWidget('topic-map-expanded', {
|
||||||
const domain = l.domain;
|
const domain = l.domain;
|
||||||
if (domain && domain.length) {
|
if (domain && domain.length) {
|
||||||
const s = domain.split('.');
|
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('.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user