@@ -18,7 +18,7 @@ import Control.Monad (guard)
18import Data.Maybe (fromMaybe)
18import Data.Maybe (fromMaybe)
19import Data.Text (Text)
19import Data.Text (Text)
20import Text.HTML.TagSoup
20import Text.HTML.TagSoup
21−import Text.Pandoc.Builder (Blocks, Inlines)
21+import Text.Pandoc.Builder (Blocks)
22import Text.Pandoc.Definition
22import Text.Pandoc.Definition
23import Text.Pandoc.Class.PandocMonad (PandocMonad (..))
23import Text.Pandoc.Class.PandocMonad (PandocMonad (..))
24import Text.Pandoc.Parsing
24import Text.Pandoc.Parsing
@@ -59,14 +59,14 @@ pColgroup = try $ do
60-- | Parses a simple HTML table
60-- | Parses a simple HTML table
61pTable' :: PandocMonad m
61pTable' :: PandocMonad m
62− => TagParser m Inlines -- ^ Caption parser
62+ => TagParser m Blocks -- ^ Caption parser
63 -> (Text -> TagParser m [(Alignment, Blocks)]) -- ^ Table cell parser
63 -> (Text -> TagParser m [(Alignment, Blocks)]) -- ^ Table cell parser
64 -> TagParser m Blocks
64 -> TagParser m Blocks
65−pTable' inline pCell = try $ do
65+pTable' block pCell = try $ do
66 TagOpen _ attribs' <- pSatisfy (matchTagOpen "table" [])
66 TagOpen _ attribs' <- pSatisfy (matchTagOpen "table" [])
67 let attribs = toAttr attribs'
67 let attribs = toAttr attribs'
68 skipMany pBlank
68 skipMany pBlank
69− caption <- option mempty $ pInTags "caption" inline <* skipMany pBlank
69+ caption <- option mempty $ pInTags "caption" block <* skipMany pBlank
70 widths' <- (mconcat <$> many1 pColgroup) <|> many pCol
70 widths' <- (mconcat <$> many1 pColgroup) <|> many pCol
71 let pTh = option [] $ pInTags "tr" (pCell "th")
71 let pTh = option [] $ pInTags "tr" (pCell "th")
72 pTr = try $ skipMany pBlank >>
72 pTr = try $ skipMany pBlank >>
@@ -104,7 +104,7 @@ pTable' inline pCell = try $ do
104 let toRow = Row nullAttr . map B.simpleCell
104 let toRow = Row nullAttr . map B.simpleCell
105 toHeaderRow l = [toRow l | not (null l)]
105 toHeaderRow l = [toRow l | not (null l)]
106 return $ B.tableWith attribs
106 return $ B.tableWith attribs
107− (B.simpleCaption $ B.plain caption)
107+ (B.simpleCaption caption)
108 (zip aligns widths)
108 (zip aligns widths)
109 (TableHead nullAttr $ toHeaderRow head')
109 (TableHead nullAttr $ toHeaderRow head')
110 [TableBody nullAttr 0 [] $ map toRow rows]
110 [TableBody nullAttr 0 [] $ map toRow rows]