From 2ea4de9ad3a7187dea5cab3ef1bb33f9a158819f Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 30 Dec 2023 13:22:22 -0400 Subject: html: fix certain cases of tag inspect spacing --- src/util/html.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'src/util/html.js') 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); -- cgit 1.3.0-6-gf8a5