RST writer: Add col spans for simple tables#11173
Conversation
src/Text/Pandoc/Writers/RST.hs
Outdated
| let hdr = if all null headers | ||
| let hdr = if null headers |
There was a problem hiding this comment.
Why the change from all null to null? This could make a difference.
There was a problem hiding this comment.
The headers were previously a List of Lists of Block [[Block]] from toLegacyTable. Now the function is operating directly on the TableHead headers which is just a List of Rows [Row].
There was a problem hiding this comment.
Still, maybe we need to also check for the case where the Rows aren't empty but they contain only empty cells? That was the case we were catching before.
There was a problem hiding this comment.
I'm not absolutely sure it's necessary, but I worry that it will be a regression.
There was a problem hiding this comment.
Gotcha. I'm gonna try to adjust my code to ensure that this check will still hold.
There was a problem hiding this comment.
Okay, I just added the helper functions isEmptyRow and isEmptyCell to be able to check for empty Rows and Cells.
src/Text/Pandoc/Writers/RST.hs
Outdated
| in (doc, Just col) : replicate (colSpan - 1) emptyDoc | ||
| | otherwise = [(doc, Just col)] | ||
|
|
||
| mapToRow colWidths docsWithColSpans = vcat $ concatMap (toRow colWidths) docsWithColSpans |
There was a problem hiding this comment.
Could be written point free: omit docsWithColSpans and change $ to ..
There was a problem hiding this comment.
Right, I changed it.
65f434b to
ad449df
Compare
ad449df to
1a44e9e
Compare
|
thanks! |
Together with the reader part from #11115 this writer part fixes #10127