« get me outta code hell

content, data: Album.nameDetail - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/transformContent.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-05-26 17:28:20 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-05-26 17:28:20 -0300
commitfba9084fc2e6650bf448656744595b6b349b2168 (patch)
tree5e1d54aa8004e3a730b392dd51d1d595de9d6adf /src/content/dependencies/transformContent.js
parent6f2d971dd3902e736406579e96486d599d98529a (diff)
content, data: Album.nameDetail
Diffstat (limited to 'src/content/dependencies/transformContent.js')
-rw-r--r--src/content/dependencies/transformContent.js21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index b2d878ac..4079f0f0 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -3,6 +3,7 @@ import {basename} from 'node:path';
 import {logWarn} from '#cli';
 import {bindFind} from '#find';
 import {replacerSpec, parseContentNodes} from '#replacer';
+import {errors} from '#sugar';
 
 import {Marked} from 'marked';
 import striptags from 'striptags';
@@ -625,28 +626,12 @@ export default {
             if (hash) link.setSlot('hash', hash);
 
             // TODO: This is obviously hacky.
-            let hasPreferShortNameSlot;
-            try {
-              link.getSlotDescription('preferShortName');
-              hasPreferShortNameSlot = true;
-            } catch {
-              hasPreferShortNameSlot = false;
-            }
-
-            if (hasPreferShortNameSlot) {
+            if (!errors(() => link.getSlotDescription('preferShortName'))) {
               link.setSlot('preferShortName', slots.preferShortLinkNames);
             }
 
             // TODO: The same, the same.
-            let hasTooltipStyleSlot;
-            try {
-              link.getSlotDescription('tooltipStyle');
-              hasTooltipStyleSlot = true;
-            } catch {
-              hasTooltipStyleSlot = false;
-            }
-
-            if (hasTooltipStyleSlot) {
+            if (!errors(() => link.getSlotDescription('tooltipStyle'))) {
               link.setSlot('tooltipStyle', 'none');
             }