Fix cover page: use valid page break so content starts on page 2
Mirror and run GitLab CI / build (push) Has been cancelled
Ruff / ruff (push) Has been cancelled

This commit is contained in:
admin
2026-06-20 03:25:24 +00:00
parent ecd40f42c2
commit 197feb2d4b
+1 -9
View File
@@ -58,15 +58,7 @@ def _add_blank_lines(doc: Document, count: int):
def _add_page_break(doc: Document):
"""Insert a page break paragraph to force next content to page 2."""
p = doc.add_paragraph()
pPr = p._p.get_or_add_pPr()
# Clean existing formatting
for child in list(pPr):
tag = child.tag.split("}")[-1] if "}" in child.tag else child.tag
if tag in ("tabs", "spacing", "ind"):
pPr.remove(child)
page_break = OxmlElement("w:pageBreak")
page_break.set("{http://schemas.openxmlformats.org/wordprocessingml/2006/main}val", "1")
pPr.append(page_break)
p.paragraph_format.page_break_before = True
def add_cover_page(