« get me outta code hell

html: Tag.#getContentJoiner() - 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>2024-03-26 09:35:58 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-03-26 09:37:11 -0300
commit9b1047826fae0f7f3d4f8cad814e4be1e280e46a (patch)
tree5fa4c3b16b34d31494843d3666bf944bec0c63f9
parenta5cab47cde587695b3e23eb035044299715f0124 (diff)
html: Tag.#getContentJoiner()
-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 = '';