« get me outta code hell

html: isBlank: Tag.normalize(template) to detect onlyIfContent - 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>2025-06-14 19:34:20 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-06-14 19:34:20 -0300
commit09588ce5589003cc06873ce343af46428e2ebca2 (patch)
tree028f93b28346bf7b19330be1303b9d90fd7e6339 /src
parent64c391910a96c20f46a508c26e5f4de7aa604cf6 (diff)
html: isBlank: Tag.normalize(template) to detect onlyIfContent
Diffstat (limited to 'src')
-rw-r--r--src/html.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/html.js b/src/html.js
index 49700775..3bec4269 100644
--- a/src/html.js
+++ b/src/html.js
@@ -223,7 +223,11 @@ 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) {
-      const content = template.content;
+      // Resolve the content all the way down to a tag -
+      // if it's a template that returns another template,
+      // that won't do, because we need to detect if its
+      // final content is a tag marked onlyIfSiblings.
+      const content = normalize(template);
 
       if (content instanceof Tag && content.onlyIfSiblings) {
         continue;