From aecc0b6cacd48648f57473a47a80c7c02ad0364e Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 28 Aug 2022 10:33:47 +0300 Subject: [PATCH] bugfix... Signed-off-by: Alex A. Naanou --- pwiki/page.js | 2 +- pwiki/store/base.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pwiki/page.js b/pwiki/page.js index a3bb7ab..6b3d8a3 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -747,7 +747,7 @@ object.Constructor('Page', BasePage, { seen.has(full) ? 'direct' : 'depth-limit' - } recursion detected:`, seen) + } recursion detected:`, full, seen) yield page.get(page.RECURSION_ERROR).parse() continue } // have the 'recursive' arg... diff --git a/pwiki/store/base.js b/pwiki/store/base.js index b2480a5..06c259b 100755 --- a/pwiki/store/base.js +++ b/pwiki/store/base.js @@ -110,6 +110,7 @@ module.BaseStore = { // local paths... __paths: cached('paths', async function(){ return this.__paths__() }), + // NOTE: this produces an unsorted list... // XXX should this also be cached??? paths: async function(local=false){ return this.__paths() @@ -288,7 +289,11 @@ module.BaseStore = { m && (!strict || m[0] == p) - && res.add(m[0]) + && res.add( + // normalize the path elements... + m[0][0] == '/' ? + m[0].slice(1) + : m[0]) return res }, new Set())] .sortAs(order) } // direct search...