minor tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-04-26 14:42:01 +03:00
parent 33ae0c690d
commit 08844b8ae0

View File

@ -684,20 +684,28 @@ object.Constructor('Page', BasePage, {
//NO_FILTERS: 'nofilters', //NO_FILTERS: 'nofilters',
ISOLATED_FILTERS: 'isolated', ISOLATED_FILTERS: 'isolated',
//
// <filter>(<source>)
// -> <result>
// -> undefined
//
// XXX might be a good idea to fix filter order... // XXX might be a good idea to fix filter order...
filters: { filters: {
// if this is used all other filters will be skipped (placeholder) // placeholders...
nofilters: function(source){ return source }, nofilters: function(){},
isolated: function(source){ return source }, isolated: function(){},
// XXX move to docs... // XXX TESTING...
dummy: function(){},
test: function(source){ test: function(source){
return source return source
.replace(/ test /g, ' TEST ') }, .replace(/ test /g, ' TEST ') },
wikiword: function(source){ wikiword: function(source){
// XXX
return source }, return source },
markdown: function(source){ markdown: function(source){
// XXX
return source }, return source },
}, },
@ -853,11 +861,13 @@ object.Constructor('Page', BasePage, {
if(that.filters[filter] == null){ if(that.filters[filter] == null){
throw new Error( throw new Error(
'.postProcess(..): unsupported filter: '+ filter) } '.postProcess(..): unsupported filter: '+ filter) }
return that.filters[filter].call(that, res) }, section) return that.filters[filter].call(that, res)
?? res }, section)
: section } }) : section } })
.flat() .flat()
.join('') }, .join('') },
// XXX do we need boht this and .postProcess(..) ???
render: function(state={}){ render: function(state={}){
return this.postProcess(null, state) }, return this.postProcess(null, state) },