diff --git a/pwiki/page.js b/pwiki/page.js index a710f0d..5595d8e 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -675,12 +675,12 @@ object.Constructor('Page', BasePage, { var outer_filters = state.filters state.filters = this.__parser__.normalizeFilters(filters) var res = - this.parse(ast, state) + await this.parse(ast, state) .iter() .flat() .join('') state.filters = outer_filters - return { data: await res } } } }, + return { data: res } } } }, // // @include() // diff --git a/pwiki/parser.js b/pwiki/parser.js index 1f015e3..5587c4b 100755 --- a/pwiki/parser.js +++ b/pwiki/parser.js @@ -461,12 +461,13 @@ module.BaseParser = { // 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' ? - section.call(page, state) - : section }) + return await Promise.iter((await ast) + // post handlers... + .map(function(section){ + return typeof(section) == 'function' ? + // NOTE: this can produce promises... + section.call(page, state) + : section })) .flat() // filters... // XXX if one of the post-handlers is a promise this will diff --git a/pwiki2-test.js b/pwiki2-test.js index 3e96da9..6749258 100755 --- a/pwiki2-test.js +++ b/pwiki2-test.js @@ -71,6 +71,14 @@ pwiki.pwiki Included quoted text: --- + --- + + Quote filters: + --- + + test filters... + + --- `, }) .update({