diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/linkExternal.js | 2 | ||||
-rw-r--r-- | src/data/things/language.js | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/content/dependencies/linkExternal.js b/src/content/dependencies/linkExternal.js index f0947cb7..afdfe6ef 100644 --- a/src/content/dependencies/linkExternal.js +++ b/src/content/dependencies/linkExternal.js @@ -33,7 +33,7 @@ export default { }); // Fall back to platform if nothing matched the desired style. - if (!formattedText && slots.style !== 'platform') { + if (html.isBlank(formattedText) && slots.style !== 'platform') { formattedText = language.formatExternalLink(data.url, { style: 'platform', diff --git a/src/data/things/language.js b/src/data/things/language.js index 4079ee71..5573ce28 100644 --- a/src/data/things/language.js +++ b/src/data/things/language.js @@ -540,10 +540,16 @@ export class Language extends Thing { isExternalLinkStyle(style); - return getExternalLinkStringOfStyleFromDescriptors(url, style, this.externalLinkSpec, { - language: this, - context, - }); + const result = + getExternalLinkStringOfStyleFromDescriptors(url, style, this.externalLinkSpec, { + language: this, + context, + }); + + // It's possible for there to not actually be any string available for the + // given URL, style, and context, and we want this to be detectable via + // html.blank(). + return result ?? html.blank(); } formatIndex(value) { |