summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Shared.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers/Shared.hs')
-rw-r--r--src/Text/Pandoc/Writers/Shared.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs
index 3b28c58c8..299c6faaf 100644
--- a/src/Text/Pandoc/Writers/Shared.hs
+++ b/src/Text/Pandoc/Writers/Shared.hs
@@ -246,7 +246,8 @@ gridTable opts blocksToDoc headless aligns widths headers rows = do
let handleZeroWidths = do
rawHeaders' <- mapM (blocksToDoc opts) headers
rawRows' <- mapM (mapM (blocksToDoc opts)) rows
- let numChars = maximum . map offset
+ let numChars [] = 0
+ numChars xs = maximum . map offset $ xs
let widthsInChars' =
map ((+2) . numChars) $ transpose (rawHeaders' : rawRows')
if sum widthsInChars' > writerColumns opts