aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/RST.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-04-11 09:51:03 -0700
committerJohn MacFarlane <[email protected]>2025-05-14 13:11:37 -0700
commit4ec69b2679b24ce426626a51b22e18b054f86ea6 (patch)
tree08cc6e9c95accc3bf23ae50ea6ff4cfab0cdf7c8 /src/Text/Pandoc/Writers/RST.hs
parentbe9fbb3f6731dc6223816677aab6c64243511c8f (diff)
T.P.Writers.Shared: New version of `gridTable`.issue6344
This handles row and colspans. Partially addresses #6344. It also ensures that cells won't wrap text in places where it wouldn't normally wrap, even if this means making the cells wider than requested by the colspec. (Closes #9001. Closes 7641.) Parameters are different, so this is a breaking [API change]. Markdown, RST, and Muse writers have been adjusted to use the new `gridTable`.
Diffstat (limited to 'src/Text/Pandoc/Writers/RST.hs')
-rw-r--r--src/Text/Pandoc/Writers/RST.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index 1b4b59cc2..01deeb969 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -329,7 +329,8 @@ blockToRST (BlockQuote blocks) = do
contents <- blockListToRST blocks
return $ nest 3 contents <> blankline
blockToRST (Table _attrs blkCapt specs thead tbody tfoot) = do
- let (caption, aligns, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot
+ let (caption, aligns, widths, headers, rows) =
+ toLegacyTable blkCapt specs thead tbody tfoot
caption' <- inlineListToRST caption
let blocksToDoc opts bs = do
oldOpts <- gets stOptions
@@ -338,9 +339,7 @@ blockToRST (Table _attrs blkCapt specs thead tbody tfoot) = do
modify $ \st -> st{ stOptions = oldOpts }
return result
opts <- gets stOptions
- let renderGrid = gridTable opts blocksToDoc (all null headers)
- (map (const AlignDefault) aligns) widths
- headers rows
+ let renderGrid = gridTable opts blocksToDoc specs thead tbody tfoot
isSimple = all (== 0) widths && length widths > 1
renderSimple = do
tbl' <- simpleTable opts blocksToDoc headers rows