Introduce configurable parameters for minimum rows and columns in table detection #307
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.
Description
This PR introduces two new parameters to control table detection during Markdown output:
min_table_rows
: Minimum number of rows required for a table to be includedmin_table_cols
: Minimum number of columns required for a table to be includedBoth parameters include basic validation to prevent invalid values.
Motivation / Background
In the current implementation, tables with fewer than 2 rows are automatically excluded. While this works for most cases, real-world PDFs sometimes contain edge cases where a single-row table should still be recognized:
In these situations, treating all single-row tables as invalid leads to loss of useful information. By making the minimum rows and columns configurable, users gain flexibility to adapt table detection to their specific document structures.
Changes
min_table_rows
andmin_table_cols
Notes
This change preserves the current default behavior (
min_table_rows = 2
,min_table_cols = 2
) to avoid breaking existing usage, while allowing users to override when needed.