From 92bd1083a83ac22866d355bbdec157e832245f5b Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 6 Aug 2022 01:37:34 +0300 Subject: [PATCH] notes, docs and some tweaks... Signed-off-by: Alex A. Naanou --- pwiki/parser.js | 11 +++++++++++ pwiki2-test.js | 4 ++-- pwiki2.js | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pwiki/parser.js b/pwiki/parser.js index 2290fe3..ac90a13 100755 --- a/pwiki/parser.js +++ b/pwiki/parser.js @@ -441,6 +441,15 @@ module.BaseParser = { // - expand macros -- .expand(..) // - apply filters // + // NOTE: this has to synchronize everything between stage 1 (up to + // and including expand) and stage 2 (post-handlers, filters, ...) + // because the former need a fully loaded and expanded page if + // we want to do this in 2 stages and not 3... + // XXX might be fun to try a load-and-tweak approach the first + // version used -- i.e. setting placeholders and replacing + // them on demand rather than on encounter (as is now), e.g. + // a slot when loaded will replace the prior occurrences... + // // XXX add a special filter to clear pending filters... (???) parse: async function(page, ast, state={}){ var that = this @@ -460,6 +469,8 @@ module.BaseParser = { : section }) .flat() // filters... + // XXX if one of the post-handlers is a promise this will + // need to sync... .map(function(section){ return ( // expand section... diff --git a/pwiki2-test.js b/pwiki2-test.js index 3bb19eb..b446326 100755 --- a/pwiki2-test.js +++ b/pwiki2-test.js @@ -71,9 +71,9 @@ pwiki.pwiki text: object.doc` Testing slot mechanics... - This slot is unfilled + This slot is (unfilled) - ...while this text should be replaced... + ...while this (text should be replaced...) text is filling a slot `, diff --git a/pwiki2.js b/pwiki2.js index 842376e..deb3402 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -2,6 +2,7 @@ * * * XXX wikiword filter seems to act up on / +* XXX BUG? /test/wikiword -- produces nested links... * * * XXX ROADMAP: @@ -16,7 +17,7 @@ * ...handle relative urls (???) * - migrate bootstrap * - store topology -* - WikiWord +* - WikiWord -- DONE * - markdown -- DONE?? * - pwa * - archive old code