Skip to content

RST Reader: Add col spans for simple tables#11115

Merged
jgm merged 1 commit intojgm:mainfrom
TuongNM:rst-reader-simple-table-col-spans
Sep 9, 2025
Merged

RST Reader: Add col spans for simple tables#11115
jgm merged 1 commit intojgm:mainfrom
TuongNM:rst-reader-simple-table-col-spans

Conversation

@TuongNM
Copy link
Contributor

@TuongNM TuongNM commented Sep 6, 2025

This adds col span support for simple tables into the RST reader. This is only the reader part of #10127.

Added a couple of additional functions into GridTable that use RowSpan and ColSpan to support this.
Also adjusted simpleDashedLines to not count trailing whitespaces after the last dashes as this would otherwise mess with aligning the col spans with the table border.

Comment on lines +64 to +76
tableWithSpans,
tableWithSpans',
widthsFromIndices,
gridTableWith,
gridTableWith',
TableComponents (..),
TableNormalization (..),
toTableComponents,
toTableComponents',
toTableComponentsWithSpans,
toTableComponentsWithSpans',
singleRowSpans,
singleColumnSpans,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Just be sure to use the string [API change] in your commit message and indicate what has changed (this is an exported module).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I added an explanation for the new functions into the commit message.

[API change] Text.Pandoc.Parsing: New functions `tableWithSpans`,
`tableWithSpans'`, `toTableComponentsWithSpans` and
`toTableComponentsWithSpans'` take a list of lists of
(Blocks, RowSpan, ColSpan) to parse a Table with different RowSpan and
ColSpan values accordingly.
New helper functions `singleRowSpans` and `singleColumnSpans` help set
all RowSpans or ColSpans to be 1 in case the table format only allows
setting one or the other.
@TuongNM TuongNM force-pushed the rst-reader-simple-table-col-spans branch from 23c4408 to 29d44f4 Compare September 8, 2025 15:04
@jgm jgm merged commit 47e1cc4 into jgm:main Sep 9, 2025
11 of 14 checks passed
@jgm
Copy link
Owner

jgm commented Sep 9, 2025

thanks!

@TuongNM TuongNM deleted the rst-reader-simple-table-col-spans branch September 9, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants