From 18daeb27ff8c0b0bcad39f1a9cec2f2f10f95cb1 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 5 Jul 2026 15:35:02 +0300 Subject: [PATCH] tweaking... Signed-off-by: Alex A. Naanou --- v3/pwiki/parser.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/v3/pwiki/parser.js b/v3/pwiki/parser.js index c04ac9c..86ba1b6 100644 --- a/v3/pwiki/parser.js +++ b/v3/pwiki/parser.js @@ -1313,7 +1313,7 @@ module.parser = { // content handler... handler ??= function(page, body, path, text, state){ - // check for recursion... + // handle recursion... // XXX for some reason this does not work for async... // ...and works quite differently in tests and // in console -- returns [object Object] in the @@ -1327,21 +1327,21 @@ module.parser = { // XXX check cache??? - var res = args.isolated ? - this.resolve( - page, - text, - Object.assign( - args.isolated == 'partial' ? - serialize.partialDeepCopy(state) - : {}, - {include_stack})) - : this.expand(page, text, state) - - // handle recursion... return Promise.awaitOrRun( - res, - function(){ + + args.isolated ? + this.resolve( + page, + text, + Object.assign( + args.isolated == 'partial' ? + serialize.partialDeepCopy(state) + : {}, + {include_stack})) + : this.expand(page, text, state), + + function(res){ + // handle recursion... state.include_stack.at(-1) == src && state.include_stack.pop() // cleanup...