« get me outta code hell

content: transformContent: blank if no content - 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-06-12 13:58:55 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:09 -0300
commit715d04fed0dc45d0479dae79d6eed2c564479794 (patch)
tree732b97b844052d484968820c200c10b35fba215b
parentbb41118cc61a0b54a83b6c8a1a936b8ec6bd0f5e (diff)
content: transformContent: blank if no content
-rw-r--r--src/content/dependencies/transformContent.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index 84fbe361..ee2c3938 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -45,7 +45,7 @@ export default {
   sprawl(wikiData, content) {
     const find = bindFind(wikiData);
 
-    const parsedNodes = parseInput(content);
+    const parsedNodes = parseInput(content ?? '');
 
     return {
       nodes: parsedNodes
@@ -512,7 +512,11 @@ export default {
         addText(markedOutput.slice(parseFrom));
       }
 
-      return html.tags(tags, {[html.joinChildren]: ''});
+      return (
+        html.tags(tags, {
+          [html.joinChildren]: '',
+          [html.onlyIfContent]: true,
+        }));
     };
 
     if (slots.mode === 'inline') {