diff --git a/scraibe/docx_cover.py b/scraibe/docx_cover.py index 0ca9c35..686b696 100644 --- a/scraibe/docx_cover.py +++ b/scraibe/docx_cover.py @@ -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(