From 2d3b9508fb5f6ae317521228e2979c3dbdf6ee02 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 18 Jun 2024 18:09:18 -0300 Subject: content: gCTExternalLinkSection: fix 'Other' for 3+ domain parts --- .../dependencies/generateContributionTooltipExternalLinkSection.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/content/dependencies') diff --git a/src/content/dependencies/generateContributionTooltipExternalLinkSection.js b/src/content/dependencies/generateContributionTooltipExternalLinkSection.js index d4342098..4f9a23ed 100644 --- a/src/content/dependencies/generateContributionTooltipExternalLinkSection.js +++ b/src/content/dependencies/generateContributionTooltipExternalLinkSection.js @@ -58,8 +58,10 @@ export default { // don't have a way of telling formatExternalLink to *not* // use the fallback string, which just formats the URL as // its host/domain... so is technically detectable. - ((html.resolve(platform, {normalize: 'string'}) === - (new URL(url)).host) + (((new URL(url)) + .host + .endsWith( + html.resolve(platform, {normalize: 'string'}))) ? language.$(capsule, 'noExternalLinkPlatformName') : platform)), -- cgit 1.3.0-6-gf8a5