From 5a6c7a032861a988cd2171874be15c7ae391517e Mon Sep 17 00:00:00 2001 From: FoxMoss Date: Mon, 30 Sep 2024 20:58:07 -0500 Subject: [PATCH] fix: block nesting $if --- src/core.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core.js b/src/core.js index df77df6..f98d13c 100644 --- a/src/core.js +++ b/src/core.js @@ -210,6 +210,11 @@ export function $if(condition, then, otherwise) { otherwise ??= doc.createTextNode('') if (!isDLPtr(condition)) return condition ? then : otherwise + assert( + !(IF in then || IF in otherwise), + 'Elements in $if cannot also be an $if macro' + ) + return { [IF]: condition, then, otherwise } }