Repository navigation
fix(header): keep a first row whose labels wrap onto a second line - #226
Open
mangeshraut712 wants to merge 2 commits into
Open
mangeshraut712 wants to merge 2 commits into
mangeshraut712 wants to merge 2 commits into
Conversation
A first-row label holding a line break (a second paragraph or a Shift+Enter break in a Word cell) made resolve_header_rows treat the row as data, so the table got an empty header row above it. A wrapped label is now accepted unless one of its lines is a number, date or boolean. It casts no vote of its own, so the row is promoted only on the votes of its single-line labels, and the row-shape fallback still requires single-line labels. This keeps rows such as 'Alice | N/A<br>(not measured)' over a numeric column in the body. Fixes firecrawl#223
… label 'col\n2' was rejected early because its second line is a number, so it never reached the row-shape fallback it was meant to cover.
Author
|
Small test follow-up in the latest commit: the all-text case used |
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.
Summary
resolve_header_rowsreturned 0 as soon as a first-row label contained a line break, so a Word table whose label wraps onto a second line (a second paragraph or a Shift+Enter break) got an empty header row, with the real labels pushed into the body.The rule is now:
name | 12<br>13stays in the body).That keeps the false positive mentioned in the issue in the body:
Alice | N/A<br>(not measured)over a numeric column has no single-line label voting for it, so nothing changes there.Fixes #223.
Verification
multiline_label_abstains_and_defers_to_single_line_votescovers the issue table, theAlice | N/A<br>(not measured)row, a wrapped numeric cell and an all-text table with a wrapped label.cargo run --example convert:| Date | Start<br>End | Room |as the header. Onmainboth give an empty header row.Alicetable renders the same as onmain(empty header,Alicerow in the body).cargo test --lib: 287 passed.cargo test --tests: header_collision, robustness and snapshot suites pass, with no snapshot changes.cargo fmt --all -- --checkandcargo clippy --all-targetsclean.Summary by cubic
Fixes header row detection for Word tables whose first-row labels wrap onto a second line (second paragraph or Shift+Enter break), so the table keeps a real header instead of an empty one with labels pushed into the body.
Alice | N/A<br>(not measured)over numeric data in the body.Fixes #223.
Written for commit 3a88c2c. Summary will update on new commits.