From 9a3e621c9cdb07f41b28c423fdede08fd6c28ddc Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Fri, 24 Jun 2016 13:15:22 +0100 Subject: [PATCH] stripe off errors and kb from page titles --- .../web/app/coffee/Features/Wiki/WikiController.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/web/app/coffee/Features/Wiki/WikiController.coffee b/services/web/app/coffee/Features/Wiki/WikiController.coffee index c75ee06f86..e4f85a6c9f 100644 --- a/services/web/app/coffee/Features/Wiki/WikiController.coffee +++ b/services/web/app/coffee/Features/Wiki/WikiController.coffee @@ -39,6 +39,13 @@ module.exports = WikiController = if pageData.content?.length > 280 if _.include(other_lngs, req.lng) pageData.title = pageData.title.slice(0, pageData.title.length - (req.lng.length+1) ) + + if pageData.title?.toLowerCase()?.indexOf("kb") == 0 + pageData.title = pageData.title.slice(3) + + if pageData.title?.toLowerCase()?.indexOf("errors") == 0 + pageData.title = pageData.title.slice(7) + WikiController._renderPage(pageData, contents, res) else WikiController._getPageContent page, (error, pageData) ->