From b53838356bd81e91bd7c83e69fdb7bae9f866032 Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Mon, 10 Aug 2026 07:39:24 +0000 Subject: [PATCH] fix: switching the page master starts a new page style:master-page-name on a paragraph style is LibreOffice's "page break with page style": the block always opens a page, except for the master the document itself opens with. --- src/lib/import/odt.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/import/odt.ts b/src/lib/import/odt.ts index f43775e..9810f24 100644 --- a/src/lib/import/odt.ts +++ b/src/lib/import/odt.ts @@ -1141,6 +1141,9 @@ function convertParaLike(el: Element, ctx: Ctx, kind: BlockKind, boldByDefault = if (master && ctx.masterPages[ctx.masterPages.length - 1] !== master) { ctx.masterPages.push(master); attrs.sectionBreak = true; + // Switching the page master starts a new page in LibreOffice, always — except for + // the master the document opens with, which is where the text already is. + if (ctx.masterPages.length > 1) attrs.breakBefore = 'page'; } // Tab stops live in a child element of the paragraph properties, so they come from // the resolver's own walk rather than the flattened paraProps.