From 7e1bac49bcac96d7fee9348248974576f94db194 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 26 Mar 2024 09:48:33 -0300 Subject: html: chunkwrap: always provide at least one chunk --- src/util/html.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/util') diff --git a/src/util/html.js b/src/util/html.js index 227fee3..f59f919 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -706,8 +706,16 @@ export class Tag { } } - if (seenChunkwrapSplitter) { - content += ''; + if (chunkwrapSplitter) { + if (seenChunkwrapSplitter) { + content += ''; + } else { + // Since chunkwraps take responsibility for wrapping *away* from the + // parent element, we generally always want there to be at least one + // chunk that gets wrapped as a single unit. So if no chunkwrap has + // been seen at all, just wrap everything in one now. + content = `${content}`; + } } content += blockwrapClosers; -- cgit 1.3.0-6-gf8a5