diff --git a/pwiki/parser.js b/pwiki/parser.js index f934d6c..2290fe3 100755 --- a/pwiki/parser.js +++ b/pwiki/parser.js @@ -450,8 +450,9 @@ module.BaseParser = { this.expand(page, ast, state) : ast - - return ast + // NOTE: we need to await for ast here as we need stage 2 of + // parsing to happen AFTER everything else completes... + return (await ast) // post handlers... .map(function(section){ return typeof(section) == 'function' ? diff --git a/pwiki2-test.js b/pwiki2-test.js index f42e51c..3bb19eb 100755 --- a/pwiki2-test.js +++ b/pwiki2-test.js @@ -7,6 +7,8 @@ (function(require){ var module={} // make module AMD/node compatible... /*********************************************************************/ +var object = require('ig-object') + var pwiki = require('./pwiki2') // XXX for some reason this does not run quietly in browser @@ -55,6 +57,27 @@ pwiki.store.update('@pouch', { // XXX TEST... // XXX add filter tests... pwiki.pwiki + .update({ + location: '/test/wikiword', + text: object.doc` + This is a basic WikiWord test, all + the [basic] forms and Versions of + /inline/links. + + @filter(wikiword markdown) `, + }) + .update({ + location: '/test/slots', + text: object.doc` + Testing slot mechanics... + + This slot is unfilled + + ...while this text should be replaced... + + text is filling a slot + `, + }) .update({ location: '/test/a', text: 'a', diff --git a/pwiki2.js b/pwiki2.js index 24137c1..842376e 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -1,13 +1,7 @@ /********************************************************************** * * -* XXX revise macros... -* - filters behave in an odd way... -* - slots do not seem to work... -* XXX wikiword filter seems to hang on / -* XXX do filters affect the whole page or only what comes after??? -* XXX need to be able to affect the default render wrpaper... -* i.e.: /some/path (default) vs. /some/path/_view vs. /some/path/_raw +* XXX wikiword filter seems to act up on / * * * XXX ROADMAP: @@ -28,6 +22,7 @@ * - archive old code * - update docs * - refactor and cleanup +* - module structure -- DONE * - pack as electron app (???) * *