From dd3052db4b15247e1096e2c6927da9633b24854f Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 12 Jun 2024 13:58:55 -0300 Subject: content: transformContent: blank if no content --- src/content/dependencies/transformContent.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/content') diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js index 84fbe361..ee2c3938 100644 --- a/src/content/dependencies/transformContent.js +++ b/src/content/dependencies/transformContent.js @@ -45,7 +45,7 @@ export default { sprawl(wikiData, content) { const find = bindFind(wikiData); - const parsedNodes = parseInput(content); + const parsedNodes = parseInput(content ?? ''); return { nodes: parsedNodes @@ -512,7 +512,11 @@ export default { addText(markedOutput.slice(parseFrom)); } - return html.tags(tags, {[html.joinChildren]: ''}); + return ( + html.tags(tags, { + [html.joinChildren]: '', + [html.onlyIfContent]: true, + })); }; if (slots.mode === 'inline') { -- cgit 1.3.0-6-gf8a5