summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/RST.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index 6093c668b..5cce64d17 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -266,9 +266,6 @@ blockToRST (BlockQuote blocks) = do
return $ (nest tabstop contents) <> blankline
blockToRST (Table caption _ widths headers rows) = do
caption' <- inlineListToRST caption
- let caption'' = if null caption
- then empty
- else blankline <> text "Table: " <> caption'
headers' <- mapM blockListToRST headers
rawRows <- mapM (mapM blockListToRST) rows
-- let isSimpleCell [Plain _] = True
@@ -299,7 +296,11 @@ blockToRST (Table caption _ widths headers rows) = do
let head'' = if all null headers
then empty
else head' $$ border '='
- return $ border '-' $$ head'' $$ body $$ border '-' $$ caption'' $$ blankline
+ let tbl = border '-' $$ head'' $$ body $$ border '-'
+ return $ if null caption
+ then tbl $$ blankline
+ else (".. table:: " <> caption') $$ blankline $$ nest 3 tbl $$
+ blankline
blockToRST (BulletList items) = do
contents <- mapM bulletListItemToRST items
-- ensure that sublists have preceding blank line