From 449dfad111309aa878c6e67bc05700a393a3285c Mon Sep 17 00:00:00 2001 From: Serhii Kulykov Date: Fri, 18 Oct 2024 11:55:53 +0300 Subject: [PATCH] fix: handle backslash in font-icons when generating CSS (#266) --- scripts/css-generator.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/css-generator.ts b/scripts/css-generator.ts index 15fff05..9845088 100644 --- a/scripts/css-generator.ts +++ b/scripts/css-generator.ts @@ -164,7 +164,10 @@ function shimThemableMixin(moduleId: string) { return shimModule(themableMixin, { ...themableMixinModule, css(strings: readonly string[], ...values: ReadonlyArray) { - return new CSSResult(moduleId, strings, values); + const result: readonly string[] = moduleId.endsWith('font-icons.js') + ? strings.map((string) => string.replace(/'\\\\([a-z0-9]+)'/g, "'\\$1'")) + : strings; + return new CSSResult(moduleId, result, values); }, registerStyles() {}, unsafeCSS,