fix: preserve nested Word structures and synchronize valid font families

This commit is contained in:
2026-11-05 21:54:52 +08:00
parent 0e072eed3b
commit 7f81c2015e
12 changed files with 292 additions and 28 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ def _font_names(value):
if len(tokens) == 1 and tokens[0].type == "string":
names.append(tokens[0].value)
elif tokens and all(t.type == "ident" for t in tokens):
if any(t.lower_value in ('inherit', 'initial', 'unset', 'revert', 'revert-layer', 'default') for t in tokens):
if len(tokens) == 1 and tokens[0].lower_value in ('inherit', 'initial', 'unset', 'revert', 'revert-layer', 'default'):
raise ValueError
names.append(" ".join(t.value for t in tokens))
else: