aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/RST.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers/RST.hs')
-rw-r--r--src/Text/Pandoc/Writers/RST.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index 4a3b1b066..dc732b0e6 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -296,7 +296,13 @@ blockToRST (Table caption aligns widths headers rows) = do
opts <- gets stOptions
let isSimple = all (== 0) widths
tbl <- if isSimple
- then simpleTable opts blocksToDoc headers rows
+ then do
+ tbl' <- simpleTable opts blocksToDoc headers rows
+ if offset tbl' > writerColumns opts
+ then gridTable opts blocksToDoc (all null headers)
+ (map (const AlignDefault) aligns) widths
+ headers rows
+ else return tbl'
else gridTable opts blocksToDoc (all null headers)
(map (const AlignDefault) aligns) widths
headers rows