From 67d8212f2a76476ef4ea8117fa5e2f449a3da8b0 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 29 Apr 2022 04:13:42 +0300 Subject: [PATCH] minor cleanup... Signed-off-by: Alex A. Naanou --- pwiki2.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pwiki2.js b/pwiki2.js index bb7c4fe..91fcf5d 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -982,7 +982,11 @@ object.Constructor('Page', BasePage, { // ...seems that we'll fall into recursion on definition... slot: function(args, body, state){ var name = args.name - var text = args.text ?? body + var text = args.text + ?? body + // NOTE: this can't be undefined for .expand(..) to work + // correctly... + ?? [] var slots = state.slots = state.slots @@ -1000,7 +1004,7 @@ object.Constructor('Page', BasePage, { // show first instance... : name in slots) - slots[name] = [...this.__parser__.expand(this, text ?? [], state)] + slots[name] = [...this.__parser__.expand(this, text, state)] return hidden ? ''