diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/html.js | 19 |
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); |