« 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/util
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-12 17:32:55 -0300
commitda2dbfdea3be32c5c277bb4c454d609f012a0472 (patch)
tree9f5b0bc507997729190ed0257171c1737850857e /src/util
parentaf6f7dcfc1e88fbf9fb8dd93aa8a782db06d8a3f (diff)
html: isBlank: handle onlyIfSIblings template content
Diffstat (limited to 'src/util')
-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,