From b4c945f3c727d1ce5de5a4af69d6dfa14c83468e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 9 Sep 2021 09:13:45 +0200 Subject: [PATCH] Fix config injection with custom HTML/CSS --- server/lib/client-html.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 3b0a68f4d..3529acf5e 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts @@ -382,8 +382,9 @@ class ClientHtml { } private static addServerConfig (htmlStringPage: string, serverConfig: HTMLServerConfig) { - const serverConfigString = JSON.stringify(serverConfig) - const configScriptTag = `` + // Stringify the JSON object, and then stringify the string object so we can inject it into the HTML + const serverConfigString = JSON.stringify(JSON.stringify(serverConfig)) + const configScriptTag = `` return htmlStringPage.replace(CUSTOM_HTML_TAG_COMMENTS.SERVER_CONFIG, configScriptTag) }