From 71c82c1f9ed8b367c2eddd2b24ceb1b84d52b735 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 31 Dec 2023 22:24:53 -0400 Subject: html: blankAttributes utility function --- src/util/html.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/html.js b/src/util/html.js index 073bdaab..dea346c5 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -130,6 +130,10 @@ export function blank() { return []; } +export function blankAttributes() { + return new Attributes(); +} + export function tag(tagName, ...args) { const lastArg = args.at(-1); @@ -477,7 +481,7 @@ export class Tag { const lines = []; const niceAttributes = ['id', 'class']; - const attributes = new Attributes(); + const attributes = blankAttributes(); for (const attribute of niceAttributes) { if (this.attributes.has(attribute)) { -- cgit 1.3.0-6-gf8a5