From b9602766d8a3d6c8ed31c67f49cefa8bd1a6871a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 30 Mar 2018 14:56:36 -0700 Subject: Textile reader: fixed tables with no body rows. Previously these raised an exception. Closes #4513. --- src/Text/Pandoc/Readers/Textile.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs index 7eef1b4dc..bc3bcaf26 100644 --- a/src/Text/Pandoc/Readers/Textile.hs +++ b/src/Text/Pandoc/Readers/Textile.hs @@ -395,7 +395,7 @@ table = try $ do (toprow:rest) | any (fst . fst) toprow -> (toprow, rest) _ -> (mempty, rawrows) - let nbOfCols = max (length headers) (length $ head rows) + let nbOfCols = maximum $ map length (headers:rows) let aligns = map minimum $ transpose $ map (map (snd . fst)) (headers:rows) return $ B.table caption (zip aligns (replicate nbOfCols 0.0)) -- cgit v1.2.3