From 5dd234e7b3dcdf9fb49856f86d2496c8a4aed890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D0=BA=D0=BE=D1=81=20=D0=90=D1=80=D1=82=D0=B5?= =?UTF-8?q?=D0=BC=20=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B5=D0=B2=D0=B8?= =?UTF-8?q?=D1=87?= Date: Tue, 30 Jun 2026 09:43:08 +0700 Subject: [PATCH] fix(odt): remove stray blank paragraph from template (#42) The template contained an empty 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. --- pyproject.toml | 2 +- redmine_reporter/formatters/odt.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 32b9c62..7f44df5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "redmine-reporter" -version = "1.8.0" +version = "1.8.1" description = "Redmine time-entry based issue reporter for internal use" readme = "README.md" authors = [{ name = "Artem Kokos", email = "artem-kokos@mail.ru" }] diff --git a/redmine_reporter/formatters/odt.py b/redmine_reporter/formatters/odt.py index cced24c..31b70c7 100644 --- a/redmine_reporter/formatters/odt.py +++ b/redmine_reporter/formatters/odt.py @@ -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" # Заголовок