From 97274c99910aab5daafecc4ebc0d04ff0c117b51 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 6 Dec 2016 23:20:28 +0100 Subject: Fixed some bad regressions in HTML table parser. This regression leads to the introduction of empty rows in some circumstances. Closes #3280. --- src/Text/Pandoc/Readers/HTML.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index d4360e521..0e7a33fe9 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -445,10 +445,10 @@ pTable = try $ do let isSimple = all isSinglePlain $ concat (head':rows'') let cols = length $ if null head' then head rows'' else head' -- add empty cells to short rows - let addEmpties r = case length r - cols of - n | n > 1 -> r ++ replicate n [] + let addEmpties r = case cols - length r of + n | n > 0 -> r ++ replicate n mempty | otherwise -> r - let rows = addEmpties rows'' + let rows = map addEmpties rows'' let aligns = replicate cols AlignDefault let widths = if null widths' then if isSimple -- cgit v1.2.3