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] ?? '';