From 826443926f85b72840b49cd7973e91ed80a09b5d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 16 Dec 2013 13:58:54 -0800 Subject: Docbook reader: Avoid failure if tbody contains no tr or row elements. --- src/Text/Pandoc/Readers/DocBook.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index fc29988d5..03c6140ac 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -806,7 +806,9 @@ parseBlock (Elem e) = (x >= '0' && x <= '9') || x == '.') w Nothing -> 0 :: Double - let numrows = maximum $ map length bodyrows + let numrows = case bodyrows of + [] -> 0 + xs -> maximum $ map length xs let aligns = case colspecs of [] -> replicate numrows AlignDefault cs -> map toAlignment cs -- cgit v1.2.3