From 8c38390038edcebd55f9dec8359ef983f3813425 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 27 Nov 2020 21:21:25 +0100 Subject: HTML reader tests: improve test coverage of new features --- src/Text/Pandoc/Readers/HTML/Table.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/HTML/Table.hs b/src/Text/Pandoc/Readers/HTML/Table.hs index 5a783988f..91639fa4c 100644 --- a/src/Text/Pandoc/Readers/HTML/Table.hs +++ b/src/Text/Pandoc/Readers/HTML/Table.hs @@ -214,7 +214,8 @@ normalize :: [ColWidth] -> TableHead -> [TableBody] -> TableFoot -> Either String ([ColSpec], TableHead, [TableBody], TableFoot) normalize widths head' bodies foot = do let rows = headRows head' <> concatMap bodyRows bodies <> footRows foot - let rowLength = length . rowCells + let cellWidth (Cell _ _ _ (ColSpan cs) _) = cs + let rowLength = foldr (\cell acc -> cellWidth cell + acc) 0 . rowCells let ncols = maximum (map rowLength rows) let tblType = tableType (map rowCells rows) -- fail on empty table -- cgit v1.2.3