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
+3 -3
View File
@@ -106,9 +106,9 @@ def test_word_preserves_all_settings_and_content(tmp_path: Path, engine):
assert spacing.get(W + "before") == spacing.get(W + "after") == "0"
assert spacing.get(W + "line") == "400" and spacing.get(W + "lineRule") == "exact"
ind = ppr.find(W + "ind")
# List geometry uses absolute lengths so Word's document grid cannot
# shift code/heading continuations away from their list's text column.
assert ind.get(W + "firstLineChars") == ("0" if ppr.find(W + 'numPr') is not None else "200")
# List/quote geometry uses absolute lengths, independent of Word's grid.
absolute = ppr.find(W + 'numPr') is not None or ''.join(p.itertext()).startswith('Quote')
assert ind.get(W + "firstLineChars") == ("0" if absolute else "200")
assert ind.get(W + "firstLine") == "420" and ind.get(W + "right") == "120"
assert ind.get(W + "left") == "850"
for name, value in (("keepNext", "1"), ("keepLines", "1"), ("contextualSpacing", "1"), ("pageBreakBefore", "0"), ("widowControl", "0")):