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:
@@ -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"
|
||||
|
||||
# Заголовок
|
||||
|
||||
Reference in New Issue
Block a user