mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-09 03:39:51 -06:00
Word drops the space before of an empty paragraph that follows a document's leading floating table: its PDFs of docxide-pdf's leading-empty-before-float-0 and -12 put the text after the empty anchor (beside the table) at the same place for 0 pt and 12 pt before. Flow::gap_before (crates/layout/src/flow.rs) kept it: a floating table takes no room in the flow and clears `pb.prev`, so the paragraph after it was laid out like a document's first paragraph, with its full space before. It now drops it for body block 1 when block 0 was placed floating on this page (the page's float_tables), the page is fresh and the paragraph holds nothing but markers (bookmarks, comment and permission ranges). It doesn't check that the paragraph sits beside the table, so below a full-width leading float an empty paragraph loses its space before too; that case is untested. Later pages and columns, and paragraphs with text, keep their space before. Co-authored-by: Naxvog <4963183+naxvog@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Martin Ball <martin.ball@ucscaregroup.co.uk>