Skip to content

Read a table row taller than a page cell by cell across the page break - #20

Merged
Abe-Borg merged 2 commits into
mainfrom
claude/gracious-wright-1qfqg0
Dec 1, 2026
Merged

Abe-Borg merged 2 commits into
mainfrom
claude/gracious-wright-1qfqg0

Conversation

@Abe-Borg

@Abe-Borg Abe-Borg commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

The item recorded as still open in #15.

What was wrong

A table row too tall for one page is cut with its cells side by side: one page prints the first part of each cell, the next page the rest of each. Every character is printed, in order. But the text has the first cell whole before the second begins, so the PDF, read page by page, did not read back as the text, and the check refused a document that was right. A cell that spans several rows and runs over a page read the same way.

What changed

The row prints as before. The PDF check gains a second reading (readSplitRows), used only after the plain reading has failed, so every document that passed before is judged exactly as it was.

  • A table cell may be left unfinished where the next line begins the same table's next cell.
  • What is left of it must go on at the top of the next page, before anything else of that page, and so on every page after until it is finished. A page that holds none of it while it is unfinished is refused, so no later row is read before the rest of an earlier one. It is never taken up again on the page it was left on.
  • Every printed line must be the exact text expected at one of those places. Nothing may be left over, of the pages or of the text.
  • Two cells whose last lines share a baseline come back as one line; that is read as the end of one and the rest of the other.
  • A line that two cells both hold can be read as either's. Each way is followed, the plainest first, until one reads every page to the end. Every way obeys the rules above, so this accepts nothing more. The ways tried are counted (SPLIT_ROW_TURNS, 20,000); a document that runs out is refused.

The report carries cellsAcrossPages, a count.

What it still refuses

The same PDF is refused for a text with a word changed, with text added to a cell, or with the two cells the other way round. A table on one page is read only in its own order. Comparing a row's words without their order was rejected: it would pass cells printed in the wrong columns.

After review

Both findings of the automated review were reproduced and are fixed in the second commit:

  1. The first version only put off an unfinished cell when a later page did not go on with it, so the next row could be read first and the rest of the cell a page later. That was looser than the rule written above it. It is now refused.
  2. The first version gave a line to the unfinished cell whenever it fitted, so two cells holding the same line could make it refuse a correct PDF. It now follows the other reading too.

Tests

  • Unit test with hand-made pages: seven layouts that must read and thirteen that must not, among them both review findings and a flood of identical lines that must end at the limit.
  • Fidelity check with real PDFs: two long cells of the same words, two long cells, a long cell beside a short one, three long cells over three pages, a long cell spanning three rows, and the four refusals above. The case with the same words in both cells also passed with the first version: Chromium's own layout of it was not one the first version misread, so finding 2 is held by the unit test only.
  • npm test (224) and every Electron check (xvfb-run -a npm run test:app, 57 fidelity checks) pass locally on Linux for both commits.
  • CI passed on Windows, macOS and Linux for the first commit (f71e46e). The runs for the second commit (24beed9) and for the merge were cancelled by the owner before they finished, so the review fix has been run on Linux only.
  • No such row has been met on a live page; this was found by testing.

https://claude.ai/code/session_01T34myuug2GWTRhCC4faCxL


Generated by Claude Code

A row too tall for one page is cut with its cells side by side: a page prints
the first part of each cell, the next page the rest of each. Every character
is printed, in order, but page by page it is not the order of the text, where
a cell is whole before the next begins. The PDF check refused such a
document although it was right. A cell that spans several rows and runs over
a page read the same way.

The row prints as before. The check gains a second reading, used only after
the plain one has failed, so every document that passed is judged as it was.
In it a table cell may be left unfinished where the next line begins the same
table's next cell; what is left must be printed in order and in full on a
later page, before anything else of that page, and never on the page it was
left on. Every line must be the exact text expected at one of those places,
and nothing may be left over. Two cells whose last lines share a baseline
come back as one line, and are read as the end of one and the rest of the
other. The report says cellsAcrossPages.

The same PDF is still refused for a text with a word changed, with text
added to a cell, or with the cells the other way round, and a table on one
page is read only in its own order.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T34myuug2GWTRhCC4faCxL
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T04:14:31.858063Z f71e46e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f71e46efd2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/document/verify.ts Resolved
Comment thread src/document/verify.ts Resolved
…line either way

The second reading of a PDF, for a table row taller than a page, had two faults.

It only put off an unfinished cell when a later page did not go on with it,
so the next row could be read first and the rest of the cell a page later.
What is left of a cell must now go on at the top of the next page, and of
every page after until it is finished; a page that holds none of it is
refused.

It gave a line to the unfinished cell whenever it fitted, so two cells that
hold the same line could make it refuse a correct document. Each way of
reading such a line is now followed, the plainest first, within a counted
limit. Every way obeys the same rules, so nothing more is accepted.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T34myuug2GWTRhCC4faCxL
@Abe-Borg
Abe-Borg merged commit 3e91b43 into main Dec 1, 2026
1 of 4 checks passed
@Abe-Borg
Abe-Borg deleted the claude/gracious-wright-1qfqg0 branch December 1, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants