mirror of
https://github.com/flynx/pWiki.git
synced 2025-11-01 03:20:08 +00:00
now trailing ':' are trimmed by path.normalize(..)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
f5d2b47d00
commit
f64e617ccb
@ -124,13 +124,14 @@ object.Constructor('BasePage', {
|
||||
},
|
||||
resolvePathVars: function(path, context={}){
|
||||
var that = this
|
||||
return Object.entries(this.path_vars)
|
||||
.reduce(function(res, [key, func]){
|
||||
return res
|
||||
.replace(
|
||||
new RegExp('(\\${'+key+'}|\\$'+key+')', 'g'),
|
||||
func.call(that, context))
|
||||
}, path) },
|
||||
return pwpath.normalize(
|
||||
Object.entries(this.path_vars)
|
||||
.reduce(function(res, [key, func]){
|
||||
return res
|
||||
.replace(
|
||||
new RegExp('(\\${'+key+'}|\\$'+key+')', 'g'),
|
||||
func.call(that, context))
|
||||
}, path)) },
|
||||
|
||||
// page location...
|
||||
//
|
||||
@ -914,7 +915,6 @@ object.Constructor('Page', BasePage, {
|
||||
// XXX DEPENDS_PATTERN
|
||||
depends.add(src)
|
||||
|
||||
|
||||
handler = handler
|
||||
?? async function(src, state){
|
||||
return isolated ?
|
||||
@ -1036,7 +1036,6 @@ object.Constructor('Page', BasePage, {
|
||||
// XXX DEPENDS_PATTERN
|
||||
depends.add(src)
|
||||
|
||||
|
||||
var pages = src ?
|
||||
(!expandactions
|
||||
&& await this.get(src).type == 'action' ?
|
||||
@ -1295,7 +1294,6 @@ object.Constructor('Page', BasePage, {
|
||||
// XXX DEPENDS_PATTERN
|
||||
depends.add(src)
|
||||
|
||||
|
||||
join = _getBlock('join')
|
||||
?? join
|
||||
join = join
|
||||
|
||||
@ -123,6 +123,12 @@ module = {
|
||||
// clear the trailing '/'...
|
||||
path.at(-1) == ''
|
||||
&& path.pop()
|
||||
// trim trailing ':'...
|
||||
path.at(-1)
|
||||
&& path.at(-1).endsWith(':')
|
||||
&& (path.push(
|
||||
path.pop()
|
||||
.replace(/:*$/, '')))
|
||||
/*/ XXX NORMCACHE...
|
||||
var res = format == 'string' ?
|
||||
// special case: root -> keep '/'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user