Open source · MIT · CLI and Playwright

breaklint checks the page that actually gets rendered.

Finds page-break and layout bugs in HTML documents that Paged.js typesets to PDF, and in your Playwright pages, with measured value, threshold and a CI exit code.

Before: page 2 of the checked PDF, empty below the heading; a dashed frame marks the block that is taller than the page. 2013 px > 650 px After: page 1 with report, heading and table.
Real German document, page 2 before, 1 after

Before and after the fix.

Before

Terminalexit 1
$ npx breaklint vorher.html
FAIL findings block this run · exit 1
checked 5 pages in 1 document
  · error 1 · warn 146 · info 0

error layout/unbreakable-block-too-tall
      page 2
  measured   2013 px; threshold 650.08 px
             (uncalibrated)

After

Terminalexit 0
$ npx breaklint nachher.html
PASS clean run · exit 0
checked 3 pages in 1 document
  · error 0 · warn 0 · info 0
- .zusammen { break-inside: avoid; }
+ .zusammen { break-inside: auto; } tr { break-inside: avoid; }

The table was told not to break and was taller than the page; now only the rows stay together.

Real breaklint 0.11.1 · 21 Nov 2026

How it was measured
  • A test document of our own with made-up values.
  • Pages rasterised with pdftoppm from the checked PDF.
  • Frame: position taken from the breaklint report.
  • 146 notes on single table rows left out.

Film · 0:39 · Instrumental music, no voice-over

What the film shows
  1. 0:00 Perfect in the browser. Broken on page 47. · Heading alone at the bottom · Page 48: two lines. That’s it. · Table fits on no page · Client: “What happened on page 47?” · Fri 17:58 · off to the printer · Chart label cut off · Did anyone check the PDF? · It looked fine in the browser. · Page: 1 → 212 / 212
  2. 0:06 212 pages. Check them by hand? Every single build?
  3. 0:10 One command. Every page measured.
  4. 0:13 Open source · MIT · breaklint · Layout checks for HTML to PDF, measured after pagination.
  5. 0:17 It tells you where it breaks. · Real output
  6. 0:21 Page 1: heading stranded. · Sample · page 1
  7. 0:25 Page 4: 5 % filled. · Sample · page 4
  8. 0:29 Every finding shows its numbers. · Widows & orphans · Stranded headings · Blocks too tall to fit · SVG text overflow
  9. 0:33 Catch it before your client does. · Free · open source · MIT · npx breaklint --demo

Install it, then run it

Try it without installing: npx breaklint --demo checks a bundled example with deliberate faults, so it ends with exit 1.

Installation for real documents

npm i -D breaklint
npm i -D puppeteer-core@^25.16.0 pagedjs@0.4.3 pdfjs-dist@6.2.108
  • Version 0.11.1
  • MIT licence
  • Node 22.13 or newer
  • macOS and Linux

Then npx breaklint chapter.html checks your document, with a Chromium browser on the machine. Exit 0: checked and clean. Exit 4: too little measurable, no verdict.

For GitHub Actions: uses: godarg/breaklint@v0.11.1, template in the CI recipe on GitHub ↗.

In your Playwright tests

checkPage checks a page your test has already opened for horizontal overflow, clipped content and SVG text running past its frame. Optionally also for overlapping elements, text that is too small and tap targets that are too small. Navigation and login stay with your test.

import { checkPage } from "breaklint";

// page: opened by your test
const { report } = await checkPage(page, {
  trust: "host-controlled-page",
  networkPolicy: "host-owned",
  scenario: "start",
  output: {
    dir: "layout",
    screenshot: "viewport",
  },
});
// report only at first;
// make it blocking once findings fit:
// expect(report.runVerdict).toBe("clean")

What it checks

For print HTML (Paged.js): seventeen rules, twelve of them on by default. Only the two error rules fail a build, unless you ask for more with --fail-on warn.

  • layout/unbreakable-block-too-tallUnbreakable block taller than the pageerror · default
  • svg/text-overflows-viewportText beyond the SVG viewporterror · default
  • PaginationWidows and orphans, headings at the page foot, hyphens across the break, leftover pages, half-empty pages
  • TypographyHyphen instead of dash, straight quotes, short last lines, loose word spacing
  • Figures and tablesSeparated captions, references without a target, missing table headers, drifting columns
  • Artefactsfile: references and build-machine paths
All 17 rules

Pagination

  • layout/unbreakable-block-too-tallUnbreakable block taller than the pageerror · default
  • layout/widowA single line carried to the top of the next pagewarn · default
  • layout/orphanA single line left at the foot of a pagewarn · default
  • layout/heading-at-page-bottomHeading stranded at the foot of a pagewarn · default
  • layout/orphaned-continuation-pagePage holding only the tail of a blockwarn · default
  • layout/hyphen-across-pageHyphenation across the page breakwarn · default
  • layout/half-empty-pageHalf-empty page, experimentalwarn · optional

SVG

  • svg/text-overflows-viewportText beyond the SVG viewporterror · default

Typography

  • type/spaced-hyphenHyphen instead of a dashwarn · default
  • type/straight-quotesStraight quotes in running textwarn · default
  • type/short-last-lineLast line too shortwarn · default
  • type/excessive-word-spacingOverstretched word spacingwarn · default

Artefacts

  • artifact/local-urifile: references and build-machine pathswarn · default

Figures and tables

  • figure/caption-separatedCaption on a different page from its figurewarn · optional
  • figure/dangling-referenceLocal reference without a targetwarn · optional
  • layout/table-header-not-repeatedTable header missing on a continuation pagewarn · optional
  • layout/table-column-driftColumn edges drift from the header rowwarn · optional

--profile strict switches the optional rules on.

Limits you should know

  • UncalibratedEvery threshold is a starting value: calibrated: false.
  • No footnotesPaged.js footnotes stop before the check with exit 3.
  • Fonts must loadIf a declared font fails, the run stops.
  • Isolate foreign HTMLThe document’s scripts run: check foreign files only in a container without network.
  • Not a replacement forveraPDF or pdfcpu (PDF standards), visual-diff tools (image comparison), vale or typopo (style and prose).
Why this exists

Prose linters never see a page. Typesetting systems see the page but do not know German typographic convention. For documents generated from HTML to PDF, neither existed.

It started with a chart that passed an XML validity check and a geometry check and still came out of the renderer with colliding labels. Whether a page works is decided in the renderer, with the fonts that were actually loaded.

Open community test · unpaid

Where do the measurement and a human eye disagree?

Anyone can test public or purpose-built HTML, no application needed; the guide takes about ten minutes to a report.

What becomes public

Use only material you have the right to publish: your GitHub identity, report and reproduction are public. Confidential documents, personal data and security findings do not belong in the form; submitted content is never executed.

Where it comes from

breaklint comes from Dargel Solutions, is free to use under the MIT licence and was written with AI help. Rules that cite the official German orthography rules are checked against their published text. At check time it uses no language model and no network.

Generative AI is used to create, maintain and review this page. Dargel Solutions is responsible for publication. How we work

breaklint is listed in the PeerPush directory ↗.