From a9f037a61591391066b7a51f7e1d263a1db66235 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 29 Apr 2012 13:54:35 -0700 Subject: HTML reader: Support `` and `` in tables. Closes #486. --- src/Text/Pandoc/Readers/HTML.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index ee61bbac6..536bddd39 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -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 -- cgit v1.2.3