« get me outta code hell

html: blankAttributes utility function - 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>2023-12-31 22:24:53 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-01-01 15:19:33 -0400
commit71c82c1f9ed8b367c2eddd2b24ceb1b84d52b735 (patch)
treef12fd3e27dde6ff97e9f57e61e66ec4b1275dcd8
parent2fd0a2f4210d0954ef0af67b387a3c5a3ea91ad9 (diff)
html: blankAttributes utility function
-rw-r--r--src/util/html.js6
1 files changed, 5 insertions, 1 deletions
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)) {