« get me outta code hell

html: fix certain cases of tag inspect spacing - 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>2023-12-30 13:22:22 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 13:22:22 -0400
commit2ea4de9ad3a7187dea5cab3ef1bb33f9a158819f (patch)
treefab705e67710b623f6d8af0388b6bb97bb96f52b /src
parent8f4aede2fbc9d16393fd733a7db4ea28f93eb8cb (diff)
html: fix certain cases of tag inspect spacing
Diffstat (limited to 'src')
-rw-r--r--src/util/html.js19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/util/html.js b/src/util/html.js
index 579dacce..7e3731f4 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -494,8 +494,8 @@ export class Tag {
             tagNamePart,
             attributesPart,
             (empty(this.content) ? ` />` : `>`),
-          ]
-        : []);
+          ].join(``)
+        : ``);
 
     const accentText =
       (this.tagName
@@ -508,23 +508,16 @@ export class Tag {
 
     const accentPart =
       (accentText
-        ? ` ${colors.dim(accentText)}`
+        ? `${colors.dim(accentText)}`
         : ``);
 
     const headingParts = [
-      `Tag `,
+      `Tag`,
       tagPart,
       accentPart,
-    ].flat(Infinity);
+    ];
 
-    const heading = headingParts.join('');
-      (this.tagName
-        ? (empty(this.content)
-            ? `Tag <${this.tagName + attributesPart} />`
-            : `Tag <${this.tagName + attributesPart}> (${this.content.length} items)`)
-        : (empty(this.content)
-            ? `Tag (no name)`
-            : `Tag (no name, ${this.content.length} items)`));
+    const heading = headingParts.filter(Boolean).join(` `);
 
     lines.push(heading);