HTML reader: Support <col> and <caption> in tables.

Closes #486.
This commit is contained in:
John MacFarlane 2012-04-29 13:54:35 -07:00
parent 0db7d87240
commit a9f037a615

View file

@ -228,6 +228,8 @@ pSimpleTable :: TagParser [Block]
pSimpleTable = try $ do
TagOpen _ _ <- pSatisfy (~== TagOpen "table" [])
skipMany pBlank
caption <- option [] $ pInTags "caption" inline >>~ skipMany pBlank
skipMany $ pInTags "col" block >> skipMany pBlank
head' <- option [] $ pOptInTag "thead" $ pInTags "tr" (pCell "th")
skipMany pBlank
rows <- pOptInTag "tbody"
@ -237,7 +239,7 @@ pSimpleTable = try $ do
let cols = maximum $ map length rows
let aligns = replicate cols AlignLeft
let widths = replicate cols 0
return [Table [] aligns widths head' rows]
return [Table caption aligns widths head' rows]
pCell :: String -> TagParser [TableCell]
pCell celltype = try $ do