From e85c7b765c106006d45befcefa23789c3c57484c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 15 Jun 2023 17:15:06 -0300 Subject: content: linkContribution: use nowrap when accents present --- src/content/dependencies/linkContribution.js | 41 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'src/content') diff --git a/src/content/dependencies/linkContribution.js b/src/content/dependencies/linkContribution.js index cc0cb353..210d5b01 100644 --- a/src/content/dependencies/linkContribution.js +++ b/src/content/dependencies/linkContribution.js @@ -41,25 +41,26 @@ export default { {[html.noEdgeWhitespace]: true, class: 'icons'}, language.formatUnitList(relations.artistIcons)); + const parts = ['misc.artistLink']; + const options = {artist: relations.artistLink}; + + if (hasContributionPart) { + parts.push('withContribution'); + options.contrib = data.contribution; + } + + if (hasExternalPart) { + parts.push('withExternalLinks'); + options.links = externalLinks; + } + + const content = language.formatString(parts.join('.'), options); + return ( - (hasContributionPart - ? (hasExternalPart - ? language.$('misc.artistLink.withContribution.withExternalLinks', { - artist: relations.artistLink, - contrib: data.contribution, - links: externalLinks, - }) - : language.$('misc.artistLink.withContribution', { - artist: relations.artistLink, - contrib: data.contribution, - })) - : (hasExternalPart - ? language.$('misc.artistLink.withExternalLinks', { - artist: relations.artistLink, - links: externalLinks, - }) - : language.$('misc.artistLink', { - artist: relations.artistLink, - })))); - }, + (parts.length > 1 + ? html.tag('span', + {[html.noEdgeWhitespace]: true, class: 'nowrap'}, + content) + : content)); + }, }; -- cgit 1.3.0-6-gf8a5