From 34e1c8375615a946b83ea1b87d37ff1631a17ee7 Mon Sep 17 00:00:00 2001 From: Lewis Crichton Date: Thu, 30 Nov 2023 19:23:26 +0000 Subject: [PATCH] fix: text strings not being done properly --- src/utils/themes/usercss/compiler.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/utils/themes/usercss/compiler.ts b/src/utils/themes/usercss/compiler.ts index 471557752..6e4617991 100644 --- a/src/utils/themes/usercss/compiler.ts +++ b/src/utils/themes/usercss/compiler.ts @@ -88,6 +88,15 @@ export async function compileUsercss(fileName: string) { varsToPass[k] = `${varsToPass[k]}${v.units ?? "px"}`; break; } + + case "text": { + if (preprocessor === "stylus") { + varsToPass[k] = `"${varsToPass[k].replace(/"/g, "\" + '\"' + \"")}"`; + } else { + varsToPass[k] = `"${varsToPass[k].replace(/\//g, "\\\\").replace(/"/g, '\\"')}"`; + } + break; + } } }