Docbook reader: Avoid failure if tbody contains no tr or row elements.

This commit is contained in:
John MacFarlane 2013-12-16 13:58:54 -08:00
parent 2f00f5c7c2
commit 826443926f

View file

@ -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