some fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-08-13 16:24:35 +03:00
parent c7daa906db
commit b711a2937e
3 changed files with 17 additions and 8 deletions

View File

@ -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(<path>)
//

View File

@ -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

View File

@ -71,6 +71,14 @@ pwiki.pwiki
Included quoted text:
---
<quote src="/test/slots"/>
---
Quote filters:
---
<quote filter="test">
test filters...
</quote>
---
`,
})
.update({