From 0706e4671f658eebcde3fe9023c12c7262e72cc2 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Tue, 23 Sep 2025 22:14:14 +0200 Subject: [PATCH] Normalize extracted theme fonts before loading them Ensure fonts are properly trimmed and stripped of quotes to maintain consistency and avoid potential loading issues. The default fonts defined by MUI e.g., are set as "\"Roboto\", \"Helvetica\", \"Arial\", sans-serif" which lead to an invalid font request. Fixes #1012 --- src/features/theme/services/AppThemes.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/features/theme/services/AppThemes.ts b/src/features/theme/services/AppThemes.ts index 201d93de..001052e2 100644 --- a/src/features/theme/services/AppThemes.ts +++ b/src/features/theme/services/AppThemes.ts @@ -52,7 +52,9 @@ const getFontsFromTheme = (obj: Record, fonts: string[] = []): stri const isValidFontProperty = propertyName === 'fontFamily' && propertyType === 'string'; if (isValidFontProperty) { - tmpFonts.push(propertyValue as string); + const detectedFonts = propertyValue.split(',') as string[]; + const normalizedFonts = detectedFonts.map((detectedFont) => detectedFont.replace(/"/g, '').trim()); + tmpFonts.push(...normalizedFonts); // eslint-disable-next-line no-continue continue; }