fix: preserve list context and nested CSS decoration behavior

This commit is contained in:
2026-11-05 09:49:52 +08:00
parent d0f95d277a
commit 77ee046463
10 changed files with 284 additions and 79 deletions
+4 -2
View File
@@ -152,13 +152,15 @@ def test_nested_quoted_lists_keep_depth_numbering_and_emphasis(tmp_path,engine):
values={}
for p in effective_document(doc,styles).iter(W+'p'):
text=''.join(p.itertext()); props=p.find(W+'pPr')
values[text]=props.find(W+'ind').get(W+'leftChars')
# Absolute indents are needed when the quote and list use different
# font sizes. Compare the resulting distance, not its storage unit.
values[text]=int(props.find(W+'ind').get(W+'left'))
assert props.find(W+'numPr') is not None
if text in ('OuterQuote','NestedQuote'):
run=next(r for r in p.iter(W+'r') if ''.join(r.itertext())==text)
assert run.find('w:rPr/w:b',NS).get(W+'val')=='1'
assert run.find('w:rPr/w:color',NS).get(W+'val')=='ff0000'
assert int(values['NestedQuote'])>int(values['OuterQuote'])
assert values['NestedQuote']-values['OuterQuote']==36*20
def test_graphical_quote_edit_overrides_important_broad_p(qt_application,tmp_path):