diff options
author | wurstsalat <mailtrash@posteo.de> | 2023-09-06 21:12:14 +0300 |
---|---|---|
committer | wurstsalat <mailtrash@posteo.de> | 2023-09-06 21:13:07 +0300 |
commit | 40c556ade163f79f55e518a10168fc60ff0b3813 (patch) | |
tree | b04c63256cd8d138e4987f503c62c0c9e5398d3c | |
parent | 52ffe5a1293b7d58362b5123606a57894b255339 (diff) |
fix: CSSConfig: Quote font-family property correctly
Fixes #11600
-rw-r--r-- | gajim/gtk/css_config.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gajim/gtk/css_config.py b/gajim/gtk/css_config.py index c3db90d98..a683510ae 100644 --- a/gajim/gtk/css_config.py +++ b/gajim/gtk/css_config.py @@ -342,7 +342,9 @@ class CSSConfig: if rule.selectorText == selector: log.info('Set Font for: %s %s %s %s %s', selector, family, size, style, weight) - rule.style['font-family'] = family + # Quote font-family in order to avoid unquoted font-families + # (this is a bug in css_parser) + rule.style['font-family'] = f'"{family}"' rule.style['font-style'] = style rule.style['font-size'] = f'{size}pt' rule.style['font-weight'] = weight @@ -357,7 +359,9 @@ class CSSConfig: log.info('Set Font for: %s %s %s %s %s', selector, family, size, style, weight) rule = CSSStyleRule(selectorText=selector) - rule.style['font-family'] = family + # Quote font-family in order to avoid unquoted font-families + # (this is a bug in css_parser) + rule.style['font-family'] = f'"{family}"' rule.style['font-style'] = style rule.style['font-size'] = f'{size}pt' rule.style['font-weight'] = weight @@ -416,6 +420,11 @@ class CSSConfig: weight = rule.style.getPropertyValue('font-weight') or None family = rule.style.getPropertyValue('font-family') or None + if family is not None: + # Unquote previously quoted font-family + # (this is a bug in css_parser) + family = family.strip('"') + desc = self._get_description_from_css( family, size, style, weight) if not pre: |