fix(odt): remove stray blank paragraph from template (#42)

The template contained an empty <text:p/> that was rendered as
a blank line before the report header.  After loading the template,
strip all text:p children so that ODT output no longer depends on
template editing artifacts.

Closes #42.
This commit is contained in:
Кокос Артем Николаевич
2026-06-30 09:43:08 +07:00
parent 59af7ce464
commit 5dd234e7b3
2 changed files with 8 additions and 1 deletions

View File

@@ -31,6 +31,13 @@ class ODTFormatter(Formatter):
with resources.files("redmine_reporter").joinpath("templates/template.odt").open("rb") as f:
doc = load(f)
# Удаляем все текстовые параграфы из шаблона, оставляя только
# структурные элементы (forms, sequence-decls). Это защищает от
# артефактов редактирования шаблона в LibreOffice (#42).
for child in list(doc.text.childNodes):
if child.tagName == "text:p":
doc.text.removeChild(child)
para_style_name = "Standard"
# Заголовок