From 7738273b808f0ff1494f18c4cc13553505e6ac6d Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Fri, 10 Jan 2020 19:50:48 +0100 Subject: Accessibility fixes for #2149 --- server/lib/client-html.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index e59505614..1d8a08ed0 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts @@ -26,7 +26,9 @@ export class ClientHtml { } static async getDefaultHTMLPage (req: express.Request, res: express.Response, paramLang?: string) { - const html = await ClientHtml.getIndexHTML(req, res, paramLang) + const html = paramLang + ? await ClientHtml.getIndexHTML(req, res, paramLang) + : await ClientHtml.getIndexHTML(req, res) let customHtml = ClientHtml.addTitleTag(html) customHtml = ClientHtml.addDescriptionTag(customHtml) @@ -98,6 +100,7 @@ export class ClientHtml { let html = buffer.toString() + if (paramLang) html = ClientHtml.addHtmlLang(html, paramLang) html = ClientHtml.addCustomCSS(html) html = await ClientHtml.addAsyncPluginCSS(html) @@ -106,7 +109,7 @@ export class ClientHtml { return html } - private static getIndexPath (req: express.Request, res: express.Response, paramLang?: string) { + private static getIndexPath (req: express.Request, res: express.Response, paramLang: string) { let lang: string // Check param lang validity @@ -129,6 +132,10 @@ export class ClientHtml { return join(__dirname, '../../../client/dist/' + buildFileLocale(lang) + '/index.html') } + private static addHtmlLang (htmlStringPage: string, paramLang: string) { + return htmlStringPage.replace('', ``) + } + private static addTitleTag (htmlStringPage: string, title?: string) { let text = title || CONFIG.INSTANCE.NAME if (title) text += ` - ${CONFIG.INSTANCE.NAME}` -- cgit v1.2.3