Repository navigation
Fix: preserve data columns in tables with only row-scoped headers - #2582
Open
GoldArowana wants to merge 1 commit into
Open
GoldArowana wants to merge 1 commit into
GoldArowana wants to merge 1 commit into
Conversation
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
An HTML data table can use
<th scope="row">or<th scope="rowgroup">without defining column headers. The default extractor currently copies that first data row intoheadersand uses its width to truncate later rows. For example, a two-cell first row can cause a value in the third column of the next row to disappear.Keep an explicitly row-scoped first row in the data grid and let the existing generic column labels reflect the full grid width. Explicit
theadand mixed explicit column scopes retain their existing behavior. This follows up on the row-grid work in #2258.List of files changed and why
crawl4ai/table_extraction.pydistinguishes row-scoped labels from inferred column headers and uses that decision forhas_headers.tests/test_table_rowspan_grid.pyverifies header metadata and preservation of wider rows for row and row-group scopes.How Has This Been Tested?
51ccab7, three regression assertions failed and eight existing grid tests passed. On headb2553e9, 24 table-grid and Markdown-table tests passed.min_cols. Three of those failed on base.Checklist
git diff --check.