From 4295baa284f9e4ce9b62b7f5b3d2d0ad99167161 Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Fri, 28 Aug 2026 09:29:45 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20ODT=20=E2=80=94=20define=20the=20Comment?= =?UTF-8?q?=20pool=20style,=20no=20master=20ref=20for=20set-less=20section?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A comment body references LibreOffice's pool style Comment; the definition is now written the way LibreOffice re-saves it, so the package resolves without that pool. A section break with no page setup of its own no longer writes a master-page reference: the name was never defined (LibreOffice drops the dangling reference, probed), and a defined one would force a page break the editor does not make. --- src/lib/export/odt.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib/export/odt.ts b/src/lib/export/odt.ts index 7eaa092..18ab22a 100644 --- a/src/lib/export/odt.ts +++ b/src/lib/export/odt.ts @@ -4637,6 +4637,15 @@ function applyComments(odtBytes: Uint8Array, list: CommentExport[]): Uint8Array '', + '')); + } + files['content.xml'] = strToU8(content); return rezipOdt(files); } @@ -5338,6 +5347,10 @@ function applySectionMasterPages(odtBytes: Uint8Array, sets: HfSet[], pageCount: new RegExp(`]*)>${SEC}(\\d+)${SEC}`, 'g'), (_m, tag: string, attrs: string, idx: string) => { const index = Number(idx); + // A break with no page setup of its own encodes nothing: a master-page reference + // would force a page break the editor does not make (ODF cannot switch masters + // mid-page), and a dangling name is dropped by LibreOffice (probed). + if (!sets[index]) return ``; used.add(index); const sm = /text:style-name="([^"]*)"/.exec(attrs); const source = sm?.[1] ?? '';