« get me outta code hell

html: isBlank: handle onlyIfSIblings template content - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-12 13:05:50 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:07 -0300
commitd40e3b561e6354cd329a43d871ec73cd6526cee4 (patch)
treee51bc7d2b2f015fe311e33125e10d6c837add5f9 /src
parent21bf6a2b91dd7a9039b63a4b76de61a7b16edf34 (diff)
html: isBlank: handle onlyIfSIblings template content
Diffstat (limited to 'src')
-rw-r--r--src/util/html.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/util/html.js b/src/util/html.js
index 6e892031..594966ed 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -217,9 +217,17 @@ export function isBlank(content) {
     // could include content. These need to be checked too.
     // Check each of the templates one at a time.
     for (const template of result) {
-      if (!template.blank) {
-        return false;
+      const content = template.content;
+
+      if (content instanceof Tag && content.onlyIfSiblings) {
+        continue;
+      }
+
+      if (isBlank(content)) {
+        continue;
       }
+
+      return false;
     }
 
     // If none of the templates included content either,