« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/html.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/html.js b/src/util/html.js
index f01e2d87..6124b35d 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -472,6 +472,16 @@ export class Attributes {
     return this.#attributes;
   }
 
+  get blank() {
+    const attributeValues =
+      Object.values(this.#attributes);
+
+    const keepAnyAttributes =
+      attributeValues.some(value => this.#keepAttributeValue(value));
+
+    return !keepAnyAttributes;
+  }
+
   set(attribute, value) {
     if (value === null || value === undefined) {
       this.remove(attribute);