@@ -75,8 +75,8 @@ import Text.Pandoc.Options (
7575 ReaderOptions (readerExtensions, readerStripComments),
7676 extensionEnabled)
7777import Text.Pandoc.Parsing hiding ((<|>))
78−import Text.Pandoc.Shared (addMetaField, crFilter, escapeURI, extractSpaces,
79− safeRead, underlineSpan)
78+import Text.Pandoc.Shared (addMetaField, blocksToInlines', crFilter, escapeURI,
79+ extractSpaces, safeRead, underlineSpan)
8080import Text.Pandoc.Walk
8181import Text.Parsec.Error
8282import Text.TeXMath (readMathML, writeTeX)
@@ -600,8 +600,11 @@ pFigure = try $ do
600600 skipMany pBlank
601601 let pImg = (\x -> (Just x, Nothing)) <$>
602602 (pOptInTag "p" pImage <* skipMany pBlank)
603− pCapt = (\x -> (Nothing, Just x)) <$>
604− (pInTags "figcaption" inline <* skipMany pBlank)
603+ pCapt = (\x -> (Nothing, Just x)) <$> do
604+ skipMany pBlank
605+ bs <- pInTags "figcaption" block
606+ skipMany pBlank
607+ return $ blocksToInlines' $ B.toList bs
605608 pSkip = (Nothing, Nothing) <$ pSatisfy (not . matchTagClose "figure")
606609 res <- many (pImg <|> pCapt <|> pSkip)
607610 let mbimg = msum $ map fst res