« get me outta code hell

content: transformContent: harden for links within templates - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-12-19 12:11:32 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-12-19 13:25:16 -0400
commit9bb22cad44ef6a0a055823d77426a72d6f2a8d35 (patch)
tree2f5480d62e7616ac946f75683f1ca7a3301c889d
parent5bae11ecd9d828eb2dd4715d8e6a27dcc42a767f (diff)
content: transformContent: harden for links within templates
-rw-r--r--src/content/dependencies/transformContent.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index 6f1ad0c7..3d9fdd60 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -368,7 +368,15 @@ export default {
               return {type: 'text', data: nodeFromRelations.data};
             }
 
-            const {link, label, hash} = nodeFromRelations;
+            // TODO: This is a bit hacky, like the stuff below,
+            // but since we dressed it up in a utility function
+            // maybe it's okay...
+            const link =
+              html.resolve(
+                nodeFromRelations.link,
+                {slots: ['content', 'hash']});
+
+            const {label, hash} = nodeFromRelations;
 
             // These are removed from the typical combined slots({})-style
             // because we don't want to override slots that were already set