Repository navigation
Conversation
Signed-off-by: peloyl <[email protected]> Signed-off-by: H/A <[email protected]>
Signed-off-by: peloyl <[email protected]> Signed-off-by: H/A <[email protected]>
Signed-off-by: peloyl <[email protected]> Signed-off-by: H/A <[email protected]>
Contributor
|
✅ DCO Check Passed Thanks @peloyl, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🔴 1 of 2 protections blocking · waiting on 👀 reviews
🔴 Require two reviewer for test updatesWaiting for
This rule is failing.When test data is updated, we require two reviewers
Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Contributor
AI triage (advisory)Checked commit Warning The AI analysis did not finish. Only the deterministic checks are shown. Topic labels added: CI safety: not assessed. Possibly related pull requests
The |
This was referenced Nov 25, 2026
This branch has not been deployed
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.
Fixes #738.
Summary
Markdown table serialization loses which cell each rendered value came from: the result carries a single
Spanfor the wholeTableItem, and the per-cell information eachTableCellholds (bbox, grid offsets) is dropped because the table is rendered as a flat pipe table.This implements the design proposed in #738: a
CellSpanTableSerializer(aMarkdownTableSerializersubclass) that renders byte-identical text but returns aMarkdownTableSerResultwhosecell_spansmap every rendered cell occurrence back to its cell:Usage:
MarkdownDocSerializer(doc=doc, table_serializer=CellSpanTableSerializer()).Implementation notes
_flatten_header_rows' dedup/join per column and locating each part sequentially in the rendered header line, so each part is attributed to the header cell it came from. A header cell repeated over stacked header rows (deduplicated by the flattening) shares the single flattened occurrence.cell_spansis left empty rather than holding wrong ranges.DocSerializer.serialize()now returns a single part as-is at both of itscreate_ser_result()wrap points, andMarkdownDocSerializer.serialize_doc()does the same for a single part when no page breaks are required. Theserialize_doc()passthrough goes slightly beyond the item-level fix because the issue's repro goes throughMarkdownDocSerializeron a whole document; without it the subclass was still flattened away on that path. Multi-part behavior is byte-identical everywhere, and other formats'serialize_doc()implementations are untouched.Testing
tests/test_serialization.py(9): the issue's repro end-to-end (result subclass survives, 6 cell spans, distinct ranges for the duplicated3600, text identical to the default serializer), stacked header rows, stacked-header deduplication, row- and column-spanning body cells, empty cells,compact_tables=True, item-level serialization, and a multi-part document (plain result type, unchanged text).tests/test_utils.py::test_connect_time_validation_blocks_dns_rebinding, which fails identically on unmodified main (verified via stash; it depends on sandbox DNS behavior) and is unrelated to this change.ruff check/ruff formatclean on the changed files;ty checkon the changed serializer files reports the same 7 pre-existing warnings as unmodified main, none in the new code.