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 var outer_filters = state.filters
state.filters = this.__parser__.normalizeFilters(filters) state.filters = this.__parser__.normalizeFilters(filters)
var res = var res =
this.parse(ast, state) await this.parse(ast, state)
.iter() .iter()
.flat() .flat()
.join('') .join('')
state.filters = outer_filters state.filters = outer_filters
return { data: await res } } } }, return { data: res } } } },
// //
// @include(<path>) // @include(<path>)
// //

View File

@ -461,12 +461,13 @@ module.BaseParser = {
// NOTE: we need to await for ast here as we need stage 2 of // NOTE: we need to await for ast here as we need stage 2 of
// parsing to happen AFTER everything else completes... // parsing to happen AFTER everything else completes...
return (await ast) return await Promise.iter((await ast)
// post handlers... // post handlers...
.map(function(section){ .map(function(section){
return typeof(section) == 'function' ? return typeof(section) == 'function' ?
// NOTE: this can produce promises...
section.call(page, state) section.call(page, state)
: section }) : section }))
.flat() .flat()
// filters... // filters...
// XXX if one of the post-handlers is a promise this will // XXX if one of the post-handlers is a promise this will

View File

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