From 94bc49fe4ea06ae6d3b533cc55f760d1561ddfb4 Mon Sep 17 00:00:00 2001 From: web-padawan Date: Thu, 17 Oct 2024 12:40:34 +0300 Subject: [PATCH] fix: handle backslash in font-icons when generating CSS --- 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,