From 8ba78dd771b5707b380f686bb8382140e1976970 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Fri, 1 Nov 2019 23:59:22 -0400 Subject: [PATCH] fix: handle link reformatting from home path (#1169) --- server/modules/rendering/html-core/renderer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/rendering/html-core/renderer.js b/server/modules/rendering/html-core/renderer.js index d0472af1..400a9a74 100644 --- a/server/modules/rendering/html-core/renderer.js +++ b/server/modules/rendering/html-core/renderer.js @@ -60,7 +60,7 @@ module.exports = { if (WIKI.config.lang.namespacing) { // -> Reformat paths if (href.indexOf('/') !== 0) { - href = `/${this.page.localeCode}/${this.page.path}/${href}` + href = (this.page.path === 'home') ? `/${this.page.localeCode}/${href}` : `/${this.page.localeCode}/${this.page.path}/${href}` } else if (href.charAt(3) !== '/') { href = `/${this.page.localeCode}${href}` } @@ -74,7 +74,7 @@ module.exports = { } else { // -> Reformat paths if (href.indexOf('/') !== 0) { - href = `/${this.page.path}/${href}` + href = (this.page.path === 'home') ? `/${href}` : `/${this.page.path}/${href}` } try {