You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Padding every cell to its column's width makes a table a lot bigger when one cell is long, which is wasted when the markdown goes to an LLM and nobody reads the source. This adds pad_table_cells (default true) to turn it off.
Since Options has only public fields, this breaks struct literals without ..Default::default(), so it probably needs a 0.7. Would you take it like this, or would you prefer an enum?
Summary by CodeRabbit
New Features
Added an option to disable padding in Markdown table cells. It’s enabled by default.
Tables remain valid when padding is disabled, including those with empty cells or pipes in cell content.
No actionable comments were generated in the recent review.
Walkthrough
The change adds a public option to control table-cell padding. When padding is disabled, the table handler uses a minimum column width of one instead of content-based widths. The default remains padded output.
Changes: Table-Cell Padding
Layer / File(s)
Summary
Padding option and table rendering src/options.rs, src/element_handler/table.rs, tests/table/basic.rs, tests/turndown_cases/mod.rs
Options adds pad_table_cells, which defaults to true. The table handler uses content-based widths when padding is enabled and a minimum width of one when it is disabled. Tests cover disabled padding and the enabled setting in the Turndown cases.
This adds an opt-out for table-cell padding. The default behavior is unchanged, so existing users are unaffected. Callers who build Options with a struct literal and no default-update syntax will need to add the new field, so a minor version bump may be appropriate.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "Add pad_table_cells option" names the main change: a new public option that controls whether table cells are padded to column width. The changeset adds the field to Options, uses it in tabl…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "Add pad_table_cells option" names the main change: a new public option that controls whether table cells are padded to column width. The changeset adds the field to Options, uses it in table_handler and compute_column_widths, and adds a test for the false case. The title is specific, short, and free of vague terms. It does not cover the default value or the compatibility impact, which the description does not require.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: bf00d907-f586-4ee4-840f-1a76a92a7269
Commits
Reviewing files that changed from the base of the PR and between f8284c8 and 32626ce.
Files selected for processing: 4
src/element_handler/table.rs
src/options.rs
tests/table/basic.rs
tests/turndown_cases/mod.rs
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
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
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.
Padding every cell to its column's width makes a table a lot bigger when one cell is long, which is wasted when the markdown goes to an LLM and nobody reads the source. This adds
pad_table_cells(defaulttrue) to turn it off.Since
Optionshas only public fields, this breaks struct literals without..Default::default(), so it probably needs a 0.7. Would you take it like this, or would you prefer an enum?Summary by CodeRabbit