Fix transcript DOCX line numbering (invalid 'eachPage' value)
Mirror and run GitLab CI / build (push) Has been cancelled
Ruff / ruff (push) Has been cancelled

- Replace invalid 'eachPage' with valid 'newPage' for w:lnNumType restart attribute
- This ensures Word starts line numbering at 1 on the first page
This commit is contained in:
admin
2026-06-16 15:41:12 +00:00
parent 7fac0e7d9c
commit 598f8630de
+2 -2
View File
@@ -335,8 +335,8 @@ def _enable_line_numbering(section, start_at=1, count_by=1, restart=True):
lnNumType.set(qn("w:start"), str(start_at)) lnNumType.set(qn("w:start"), str(start_at))
lnNumType.set(qn("w:countBy"), str(count_by)) lnNumType.set(qn("w:countBy"), str(count_by))
# 'eachPage' restarts numbering on every page; 'continuous' keeps it going # 'newPage' restarts numbering on every page; 'continuous' keeps it going
restart_mode = "eachPage" if restart else "continuous" restart_mode = "newPage" if restart else "continuous"
lnNumType.set(qn("w:restart"), restart_mode) lnNumType.set(qn("w:restart"), restart_mode)
sectPr.append(lnNumType) sectPr.append(lnNumType)