Fix transcript DOCX line numbering starting at line 2
Mirror and run GitLab CI / build (push) Has been cancelled
Ruff / ruff (push) Has been cancelled

- Remove initial empty paragraph so Word's line numbering starts at first real line
This commit is contained in:
admin
2026-06-15 14:54:32 +00:00
parent d51b006a19
commit 7364d572d5
+7
View File
@@ -430,6 +430,13 @@ def create_transcript_docx(
_configure_base_font(doc) _configure_base_font(doc)
_configure_section_margins(doc) _configure_section_margins(doc)
# Remove the default empty paragraph so line numbering starts
# at the first real line of content (Word counts paragraphs, not text lines).
if doc.paragraphs:
p = doc.paragraphs[0]
if p.text.strip() == "":
p._p.getparent().remove(p._p)
# Enable line numbering for transcript section # Enable line numbering for transcript section
_enable_line_numbering(doc.sections[0]) _enable_line_numbering(doc.sections[0])