feat: a table that may not break between rows moves whole

ODF style:may-break-between-rows="false" — probed: LibreOffice leaves four
lines of a page empty rather than split such a table, and splits the identical
one when the attribute says "true". pageBreaks now emits a single atomic leaf
for the wrapper unless the table is taller than a page, where the rule cannot
be met. Imported, exported and round-tripped; Word has no equivalent.
This commit is contained in:
Steffen Becker committed 2026-08-11 00:02:31 +00:00
1 parent 0d3506a51c
commit db8f4439b1
7 files changed
+88 -19

No files matched your search

+4
View File
@@ -2049,6 +2049,10 @@ function convertTable(el: Element, ctx: Ctx): Node | null {
const named = ctx.resolver.namedAncestor(el.getAttributeNS(NS.table, 'style-name'), 'table');
const attrs: Record<string, unknown> = { ...(tableMargins(el, ctx) ?? {}), ...tableSpacing(el, ctx) };
if (cellPad) attrs.cellPadding = cellPad;
// The default is to allow a break, so only the explicit "no" is worth an attr.
if (ctx.resolver.tableProps(el.getAttributeNS(NS.table, 'style-name'))['style:may-break-between-rows'] === 'false') {
attrs.keepRows = true;
}
if (named) {
attrs.tableStyle = displayStyleName(named);
// Which conditional areas the table opts into (ODF's table template attributes).