« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-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>`;
       }