« get me outta code hell

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:
Diffstat (limited to 'src/content/dependencies/transformContent.js')
-rw-r--r--src/content/dependencies/transformContent.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index ebb4e12..03bd7bc 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -186,7 +186,7 @@ export default {
 
   slots: {
     mode: {
-      validate: v => v.is('inline', 'multiline', 'lyrics'),
+      validate: v => v.is('inline', 'multiline', 'lyrics', 'single-link'),
       default: 'multiline',
     },
 
@@ -259,6 +259,19 @@ export default {
         return getPlaceholder(node, data.content);
       });
 
+    // In single-link mode, return the link node exactly as is - exposing
+    // access to its slots.
+
+    if (slots.mode === 'single-link') {
+      const link = contentFromNodes.find(node => node.type === 'link');
+
+      if (!link) {
+        return html.blank();
+      }
+
+      return link.data;
+    }
+
     // In inline mode, no further processing is needed!
 
     if (slots.mode === 'inline') {