« 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.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/util/html.js b/src/util/html.js
index fc5d1e90..944eab78 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -527,17 +527,24 @@ export class Tag {
         : '\n'));
   }
 
+  #getContentJoiner() {
+    if (this.joinChildren === undefined) {
+      return '\n';
+    }
+
+    if (this.joinChildren === '') {
+      return '';
+    }
+
+    return `\n${this.joinChildren}\n`;
+  }
+
   #stringifyContent() {
     if (this.selfClosing) {
       return '';
     }
 
-    const joiner =
-      (this.joinChildren === undefined
-        ? '\n'
-     : this.joinChildren === ''
-        ? ''
-        : `\n${this.joinChildren}\n`);
+    const joiner = this.#getContentJoiner();
 
     let content = '';
     let blockwrapClosers = '';