« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/html.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util/html.js b/src/util/html.js
index 5144a31..20f51ea 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -1056,6 +1056,7 @@ export class Template {
           'boolean',
           'symbol',
           'html',
+          'attributes',
         ];
 
         if (slotDescription.type === 'function') {
@@ -1160,6 +1161,10 @@ export class Template {
           return isHTML(value);
         }
 
+        case 'attributes': {
+          return isAttributesAdditionSingletValue(value);
+        }
+
         case 'string': {
           // Tags and templates are valid in string arguments - they'll be
           // stringified when exposed to the description's .content() function.
@@ -1200,6 +1205,18 @@ export class Template {
       return providedValue;
     }
 
+    if (description.type === 'attributes') {
+      if (!providedValue) {
+        return blankAttributes();
+      }
+
+      if (providedValue instanceof Attributes) {
+        return providedValue.clone();
+      }
+
+      return new Attributes(providedValue);
+    }
+
     if (description.type === 'string') {
       if (providedValue instanceof Tag || providedValue instanceof Template) {
         return providedValue.toString();