zztaeha

All versions

1.0.2 release notes

Released

Fixed

  • Images, canvases, inline SVGs, and table rows inside a flex or grid container taller than one page were sliced across the page boundary. The break engine treated the container as atomic, could not push it whole, and never looked inside it. It now steps into any atomic container it did not push, so the content inside is protected. (#1)
  • Text lines inside a tall flex or grid container were cut mid-line for the same reason. This includes the common body { display: flex; flex-direction: column } wrapper, where nothing in the document was protected at all.
  • break-before and break-after on flex and grid items were silently ignored. They are now honored.
  • undoPageBreaks could leave an empty style="" attribute on a caller’s live element after a margin push. Chrome serializes the style attribute lazily, so it is now read once before removal and restored verbatim.

Changed

  • Flex and grid items that must move to the next page are pushed through their own margin-top with !important instead of a sibling spacer, since a spacer inside those containers would become an item of its own. The row or line grows to fit, matching browser print.
  • The page-top check is now symmetric about the boundary, absorbing Chrome’s 1/64px layout snapping so a push landing a hair short no longer costs a wasted iteration.
  • Text placed directly inside a grid or flex row container is left in place rather than split, since it is an anonymous item nothing can push.
  • dist/ is no longer tracked in git. The published npm package is the build artifact.

Added

  • tests/breaks.test.mjs: browser-backed regression tests for the page-break engine. Eight layouts run in headless Chrome, including the exact shape from #1, and every fixture asserts a byte-exact DOM undo. Chrome is found via CHROME_BIN, standard install paths, or the puppeteer cache, and the file skips with a notice when none is present.

Updated

  • README, “Never split without warning”: the flex and grid bullet now states that a container is pushed whole only when it fits on a page, and a new paragraph describes what happens inside a container taller than one page.
  • Comments in src/html/breaks.ts consolidated.

Notes

  • The geometric slicer still emits a 0.003pt off-page draw of a pushed image on the preceding page. Pre-existing, invisible, and identical for plain block-flow images.
  • A grid with fixed row heights cannot grow, so a pushed item overflows its track rather than stretching it.

Type to search.