git.iko.soy/typeable/pandoc
on master help sign in
Fixed some bad regressions in HTML table parser.

This regression leads to the introduction of empty rows in some circumstances. Closes #3280.

commit97274c99910aab5daafecc4ebc0d04ff0c117b51 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 6 Dec 2016, 23:20 (10 years ago) parent41627ed
1 file changed+3−3
src/Text/Pandoc/Readers/HTML.hs+3−3
src/Text/Pandoc/Readers/HTML.hs+3−3
@@ -445,10 +445,10 @@ pTable = try $ do
445445 let isSimple = all isSinglePlain $ concat (head':rows'')
446446 let cols = length $ if null head' then head rows'' else head'
447447 -- add empty cells to short rows
448− let addEmpties r = case length r - cols of
449− n | n > 1 -> r ++ replicate n []
448+ let addEmpties r = case cols - length r of
449+ n | n > 0 -> r ++ replicate n mempty
450450 | otherwise -> r
451− let rows = addEmpties rows''
451+ let rows = map addEmpties rows''
452452 let aligns = replicate cols AlignDefault
453453 let widths = if null widths'
454454 then if isSimple