git.iko.soy/typeable/pandoc
on master help sign in
Writers.Shared.gridTable: defensive coding around 'maximum'.
commitdd1ac8f48fdb4cf29c924690ecbed4557519b444 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 23 Mar 2017, 14:33 (10 years ago) parent86142ab
1 file changed+2−1
src/Text/Pandoc/Writers/Shared.hs+2−1
src/Text/Pandoc/Writers/Shared.hs+2−1
@@ -246,7 +246,8 @@ gridTable opts blocksToDoc headless aligns widths headers rows = do
246246 let handleZeroWidths = do
247247 rawHeaders' <- mapM (blocksToDoc opts) headers
248248 rawRows' <- mapM (mapM (blocksToDoc opts)) rows
249− let numChars = maximum . map offset
249+ let numChars [] = 0
250+ numChars xs = maximum . map offset $ xs
250251 let widthsInChars' =
251252 map ((+2) . numChars) $ transpose (rawHeaders' : rawRows')
252253 if sum widthsInChars' > writerColumns opts