diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-12-06 23:20:28 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-12-06 23:20:28 +0100 |
commit | 97274c99910aab5daafecc4ebc0d04ff0c117b51 (patch) | |
tree | df8bfeb71cb9eb0e62b4685c06d56cad4d128378 /src/Text/Pandoc | |
parent | 41627ed62c57d9e51a89352bc843d8265f1bc83f (diff) | |
download | pandoc-97274c99910aab5daafecc4ebc0d04ff0c117b51.tar.gz |
Fixed some bad regressions in HTML table parser.
This regression leads to the introduction of empty rows
in some circumstances.
Closes #3280.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 6 |
1 files changed, 3 insertions, 3 deletions
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 |