RST writer: Fixed bug involving empty table cells.

isSimple was being calculated in a way that assumed there
were no non-empty cells.

Resolves #299. Thanks to rmunoz for reporting the bug.
This commit is contained in:
John MacFarlane 2011-09-05 19:13:30 -07:00
parent 75b9ba2716
commit e3c560ac3d

View file

@ -176,7 +176,7 @@ blockToRST (Table caption _ widths headers rows) = do
else blankline <> text "Table: " <> caption'
headers' <- mapM blockListToRST headers
rawRows <- mapM (mapM blockListToRST) rows
let isSimple = all (==0) widths && all (all (\bs -> length bs == 1)) rows
let isSimple = all (==0) widths && all (all (\bs -> length bs <= 1)) rows
let numChars = maximum . map offset
opts <- get >>= return . stOptions
let widthsInChars =