mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-29 10:55:40 +00:00
HTML reader: fix bug in calculation of RowHeadColumns.
We were adding up cells, not colspans. Note: there may still be incorrect results in the presence of rowspans. See https://github.com/jgm/pandoc/issues/8984#issuecomment-1666467926
This commit is contained in:
@@ -133,7 +133,9 @@ pRow block = try $ do
|
||||
TagOpen _ attribs <- pSatisfy (matchTagOpen "tr" []) <* skipMany pBlank
|
||||
cells <- many (pCell block BodyCell <|> pCell block HeaderCell)
|
||||
TagClose _ <- pSatisfy (matchTagClose "tr")
|
||||
return ( RowHeadColumns $ length (takeWhile ((== HeaderCell) . fst) cells)
|
||||
return ( RowHeadColumns $ foldr (\(_, Cell _ _ _ (ColSpan colspan) _) ->
|
||||
(+ colspan)) 0
|
||||
(takeWhile ((== HeaderCell) . fst) cells)
|
||||
, Row (toAttr attribs) $ map snd cells
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user