Conversation
Author
|
Added the integration coverage suggested in #16's closing comment: a real |
This pull request was closed.
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 #8
Why
For an XLSX worksheet whose only populated cell anchors a merge extending beyond the populated range,
to_document()clipped the merge to the populated range and lost the span. The issue's reproduction (F1= "Merged heading", mergeF1:O3) returned a 1x1 table withrow_span=1, col_span=1instead of the source's 3x10 span. A valid source merge must not silently collapse to an ordinary cell.What
MAX_EXPANSIONbudget, so an oversized region keeps the previous clipped behavior instead of forcing a huge grid; a full-sheet merge can never balloon the output.keep_covered_extent()so trailing rows that consist only of covered positions are kept rather than trimmed as filler. Only the spreadsheet parser opts in, so HTML/ODF span semantics are unchanged.Markdown output is unaffected (GFM has no span syntax and the renderer already trims trailing blank rows/columns); this preserves the document model structure, exactly what the issue asks for.
Tests
merge_spanning_past_the_populated_range_is_preserved— the issue'sF1:O3reproduction now yields a 3x10 grid with a 3x10 origin span.merge_past_the_range_keeps_content_below— data below the merge survives alongside the full span.oversized_merge_falls_back_to_the_populated_range— the budget cap falls back to clipped behavior without erroring.covered_extent_rows_survive_when_preserved/covered_extent_rows_trim_without_the_flag— GridBuilder flag coverage both ways.All gates pass locally:
cargo fmt --all --check,cargo clippy -p anydoc --all-targets --all-features -- -D warnings,cargo test --locked.