diff options
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/HTML/Table.hs | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index e9fefb9c0..177a39be0 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -474,7 +474,7 @@ pHrule = do return B.horizontalRule pTable :: PandocMonad m => TagParser m Blocks -pTable = pTable' inline pCell +pTable = pTable' block pCell noColOrRowSpans :: Tag Text -> Bool noColOrRowSpans t = isNullOrOne "colspan" && isNullOrOne "rowspan" diff --git a/src/Text/Pandoc/Readers/HTML/Table.hs b/src/Text/Pandoc/Readers/HTML/Table.hs index bad39bd2d..bebb75df6 100644 --- a/src/Text/Pandoc/Readers/HTML/Table.hs +++ b/src/Text/Pandoc/Readers/HTML/Table.hs @@ -18,7 +18,7 @@ import Control.Monad (guard) import Data.Maybe (fromMaybe) import Data.Text (Text) import Text.HTML.TagSoup -import Text.Pandoc.Builder (Blocks, Inlines) +import Text.Pandoc.Builder (Blocks) import Text.Pandoc.Definition import Text.Pandoc.Class.PandocMonad (PandocMonad (..)) import Text.Pandoc.Parsing @@ -59,14 +59,14 @@ pColgroup = try $ do -- | Parses a simple HTML table pTable' :: PandocMonad m - => TagParser m Inlines -- ^ Caption parser + => TagParser m Blocks -- ^ Caption parser -> (Text -> TagParser m [(Alignment, Blocks)]) -- ^ Table cell parser -> TagParser m Blocks -pTable' inline pCell = try $ do +pTable' block pCell = try $ do TagOpen _ attribs' <- pSatisfy (matchTagOpen "table" []) let attribs = toAttr attribs' skipMany pBlank - caption <- option mempty $ pInTags "caption" inline <* skipMany pBlank + caption <- option mempty $ pInTags "caption" block <* skipMany pBlank widths' <- (mconcat <$> many1 pColgroup) <|> many pCol let pTh = option [] $ pInTags "tr" (pCell "th") pTr = try $ skipMany pBlank >> @@ -104,7 +104,7 @@ pTable' inline pCell = try $ do let toRow = Row nullAttr . map B.simpleCell toHeaderRow l = [toRow l | not (null l)] return $ B.tableWith attribs - (B.simpleCaption $ B.plain caption) + (B.simpleCaption caption) (zip aligns widths) (TableHead nullAttr $ toHeaderRow head') [TableBody nullAttr 0 [] $ map toRow rows] |