From 7783afa2eeba6eb3b876d325cd83c41fb96b4792 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 21 Mar 2023 22:21:35 -0300 Subject: data steps: deep flatten HTML This should totally obliterate the need for html.fragment. --- src/util/html.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/util') 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(); -- cgit 1.3.0-6-gf8a5