« get me outta code hell

html: don't place blockwrap at start of 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>2023-12-29 19:45:02 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 13:23:09 -0400
commitb6760d9d400b469875b9ecb034ff7e8d3b161385 (patch)
tree605ee9cafc8325561a758b8f28b817a962eef030
parentf00ed4eaf1386e03126a61a2a23e1c96bb6b2a90 (diff)
html: don't place blockwrap at start of content
-rw-r--r--src/util/html.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util/html.js b/src/util/html.js
index 08d03bc7..df7fa8c4 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -477,8 +477,10 @@ export class Tag {
 
       // Blockwraps only apply if they actually contain some content whose
       // words should be kept together, so it's okay to put them beneath the
-      // itemContent check.
-      if (item instanceof Tag && item.blockwrap) {
+      // itemContent check. They also never apply at the very start of content,
+      // because at that point there aren't any preceding words from which the
+      // blockwrap would differentiate its content.
+      if (item instanceof Tag && item.blockwrap && content) {
         content += `<span class="blockwrap">`;
         blockwrapClosers += `</span>`;
       }