« get me outta code hell

data steps: deep flatten HTML - 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:
author(quasar) nebula <qznebula@protonmail.com>2023-03-21 22:21:35 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-03-21 22:21:35 -0300
commit7783afa2eeba6eb3b876d325cd83c41fb96b4792 (patch)
treee4ccc6407a413a883c3e7763b8c9034c9e96bb32 /src/util
parent680681f89b5e3d89d953421eb4aabed7ba46d78d (diff)
data steps: deep flatten HTML
This should totally obliterate the need for html.fragment.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/html.js8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/util/html.js b/src/util/html.js
index 3f89a280..63d7c1cf 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -126,13 +126,7 @@ export class Tag {
     }
 
     this.#content = contentArray
-      .flatMap(value => {
-        if (Array.isArray(value)) {
-          return value;
-        } else {
-          return [value];
-        }
-      })
+      .flat(Infinity)
       .filter(Boolean);
 
     this.#content.toString = () => this.#stringifyContent();