feat: export editable named Word styles and release 0.5.0

This commit is contained in:
2026-10-30 10:58:37 +08:00
parent 117e6b65f1
commit 151b176c1a
20 changed files with 818 additions and 169 deletions
+2
View File
@@ -40,6 +40,8 @@ def test_word_page_settings_and_inline_styles(tmp_path, engine):
style_rules={"paragraph": {"font_size": 14, "font_size_unit": "pt"}})
with zipfile.ZipFile(path) as package:
doc = etree.fromstring(package.read("word/document.xml"))
from docx_assertions import effective_document
doc = effective_document(doc, etree.fromstring(package.read('word/styles.xml')))
ns = {"w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}
assert doc.xpath("//w:pgSz/@w:orient", namespaces=ns) == ["landscape"]
assert int(doc.xpath("//w:pgSz/@w:w", namespaces=ns)[0]) > int(doc.xpath("//w:pgSz/@w:h", namespaces=ns)[0])