diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-05-03 21:08:45 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-05-03 21:08:45 -0700 |
commit | fde52c25a65c479871afcf8192f56d2918230f5e (patch) | |
tree | b2022fb491b9bdbb6e5b99ab903261233056eff5 /src/Text/Pandoc/Writers | |
parent | abd3a039b9adcafa8aa1df6e0753a725f90c78fc (diff) | |
download | pandoc-fde52c25a65c479871afcf8192f56d2918230f5e.tar.gz |
AsciiDoc writer: Correctly handle empty table cells.
Closes #1245.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/AsciiDoc.hs | 3 |
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 |