fix: read malformed table spans the way HTML does - #22
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ What changed
rowspan/colspanvalues 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.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("")is0, and the old guard only rejected< 1. Sorowspan=""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.Oversized rowspans are clamped to the row group too, so
table rowspan exceeds available rowsno 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
mainfor 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_bytessits just under the current 4.3 KB so a page stripped back to its intro fails rather than landing as a snapshot; nocatalog_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.