aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-11 03:01:27 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-11 03:01:27 +0000
commita34afa91efd1ba313d0a2b4a52a878d6e2453730 (patch)
treeae98fdc323ed31f9478904ee31328451dcfe2f1d /src/Text/Pandoc
parentea6721944903122b53c657b4901dbf687a1e416a (diff)
downloadpandoc-a34afa91efd1ba313d0a2b4a52a878d6e2453730.tar.gz
RST writer: Fixed headerless tables.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1879 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/RST.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index 04f5e0ca4..e046c5a81 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -204,8 +204,10 @@ blockToRST (Table caption _ widths headers rows) = do
map (\l -> text $ replicate l ch) widthsInChars) <>
char ch <> char '+'
let body = vcat $ intersperse (border '-') $ map blockToDoc rows'
- return $ border '-' $+$ blockToDoc head' $+$ border '=' $+$ body $+$
- border '-' $$ caption'' $$ text ""
+ let head'' = if all null headers
+ then empty
+ else blockToDoc head' $+$ border '='
+ return $ border '-' $+$ head'' $+$ body $+$ border '-' $$ caption'' $$ text ""
blockToRST (BulletList items) = do
contents <- mapM bulletListItemToRST items
-- ensure that sublists have preceding blank line