aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-05-03 21:08:45 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-05-03 21:08:45 -0700
commitfde52c25a65c479871afcf8192f56d2918230f5e (patch)
treeb2022fb491b9bdbb6e5b99ab903261233056eff5 /src/Text/Pandoc
parentabd3a039b9adcafa8aa1df6e0753a725f90c78fc (diff)
downloadpandoc-fde52c25a65c479871afcf8192f56d2918230f5e.tar.gz
AsciiDoc writer: Correctly handle empty table cells.
Closes #1245.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/AsciiDoc.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs
index 68b525742..e5868172e 100644
--- a/src/Text/Pandoc/Writers/AsciiDoc.hs
+++ b/src/Text/Pandoc/Writers/AsciiDoc.hs
@@ -217,6 +217,7 @@ blockToAsciiDoc opts (Table caption aligns widths headers rows) = do
let makeCell [Plain x] = do d <- blockListToAsciiDoc opts [Plain x]
return $ text "|" <> chomp d
makeCell [Para x] = makeCell [Plain x]
+ makeCell [] = return $ text "|"
makeCell _ = return $ text "|" <> "[multiblock cell omitted]"
let makeRow cells = hsep `fmap` mapM makeCell cells
rows' <- mapM makeRow rows
@@ -227,7 +228,7 @@ blockToAsciiDoc opts (Table caption aligns widths headers rows) = do
else 100000
let maxwidth = maximum $ map offset (head':rows')
let body = if maxwidth > colwidth then vsep rows' else vcat rows'
- let border = text $ "|" ++ replicate ((min maxwidth colwidth) - 1) '='
+ let border = text $ "|" ++ replicate (max 5 (min maxwidth colwidth) - 1) '='
return $
caption'' $$ tablespec $$ border $$ head'' $$ body $$ border $$ blankline
blockToAsciiDoc opts (BulletList items) = do