Skip to content

fix: read malformed table spans the way HTML does - #22

Merged
guillaumegay13 merged 2 commits into
mainfrom
feat/html-hardening-thinking-machines
Aug 24, 2026
Merged

guillaumegay13 merged 2 commits into
mainfrom
feat/html-hardening-thinking-machines

Conversation

@guillaumegay13

Copy link
Copy Markdown
Collaborator

✨ What changed

  • Malformed rowspan/colspan values now resolve the way HTML resolves them instead of corrupting or dropping a snapshot.
  • rowspan="0" expands to the end of its row group rather than the end of the table.
  • A table nested in another table's cell is no longer paired as either half of a split header.
  • Adds the first tests for src/sources/html.ts, and a Thinking Machines (Tinker) source.

💭 Why

Three markup quirks that a provider can ship at any time each cost us a snapshot:

  • Number("") is 0, and the old guard only rejected < 1. So rowspan="" read as "span to the end of the table" and duplicated a cell into rows the page never put it in — a snapshot asserting something the source does not say. colspan="" threw, and the whole source went dark.
  • rowspan="0" means "to the end of the row group". Scoping it to the table lets a cell bleed past its <tbody>, after which the column check fails and takes the page with it.
  • A header-only table was pairable with whatever table came next in document order, including one nested in a cell.

Oversized rowspans are clamped to the row group too, so table rowspan exceeds available rows no longer fails a page over a value a browser would simply clamp.

📝 Notes

Verified against live HTML from all eight HTML sources: the converter's output is byte-identical to main for every one of them. The behaviour changes are confined to the malformed markup the new tests cover.

Tinker publishes its retirement dates as one table on an HTML docs page with no Markdown twin. min_bytes sits just under the current 4.3 KB so a page stripped back to its intro fails rather than landing as a snapshot; no catalog_provider, since the catalog carries no Thinking Machines models yet.

Supersedes guillaumegay13#1, which was stacked on #9 before #12#21 landed most of it.

The converter treated an unparseable span as fatal and a header-only table
as pairable with any table that followed it in document order. Both turn a
markup quirk on a provider page into a lost snapshot.

- An empty or unparseable rowspan/colspan now reads as 1, and colspan="0"
  as 1, matching how HTML itself resolves them. Previously Number("") gave
  0, which let rowspan="" span to the end of the table and duplicate a cell
  into rows the page never put it in, while colspan="" threw and dropped
  the source entirely.
- rowspan="0" now expands to the end of its row group rather than the end
  of the table, and an oversized rowspan is clamped to the same bound
  instead of failing the page.
- A table nested in another table's cell is no longer paired as either half
  of a split header.

Adds the first tests for the converter, covering these cases along with the
table shapes the eight HTML sources actually render. Verified against live
HTML from all eight: output is byte-identical to before.
Tinker publishes its retirement dates as a single table on an HTML docs
page, with no Markdown twin to watch, so it joins the other HTML sources.

The markers pin the two headings the page is worth watching for, and
min_bytes sits just under the current 4.3 KB so a page stripped back to
its intro fails rather than landing as a snapshot. No catalog_provider:
the catalog carries no Thinking Machines models yet.
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modeldeprecations-dev Ready Ready Preview Aug 24, 2026 6:59pm

Request Review

@guillaumegay13
guillaumegay13 merged commit 34fa164 into main Aug 24, 2026
3 checks passed
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.

1 participant