@@ -1039,7 +1039,18 @@ normalDefinitionList = do
10391039para :: PandocMonad m => MarkdownParser m (F Blocks)
10401040para = try $ do
10411041 exts <- getOption readerExtensions
1042− result <- trimInlinesF <$> inlines1
1042+ let implicitFigures x
1043+ | extensionEnabled Ext_implicit_figures exts = do
1044+ x' <- x
1045+ case B.toList x' of
1046+ [Image attr alt (src,tit)]
1047+ | not (null alt) ->
1048+ -- the fig: at beginning of title indicates a figure
1049+ return $ B.singleton
1050+ $ Image attr alt (src,'f':'i':'g':':':tit)
1051+ _ -> return x'
1052+ | otherwise = x
1053+ result <- implicitFigures . trimInlinesF <$> inlines1
10431054 option (B.plain <$> result)
10441055 $ try $ do
10451056 newline
@@ -1062,16 +1073,7 @@ para = try $ do
10621073 if divLevel > 0
10631074 then lookAhead divFenceEnd
10641075 else mzero
1065− return $ do
1066− result' <- result
1067− case B.toList result' of
1068− [Image attr alt (src,tit)]
1069− | not (null alt) &&
1070− Ext_implicit_figures `extensionEnabled` exts ->
1071− -- the fig: at beginning of title indicates a figure
1072− return $ B.para $ B.singleton
1073− $ Image attr alt (src,'f':'i':'g':':':tit)
1074− _ -> return $ B.para result'
1076+ return $ B.para <$> result
10751077
10761078plain :: PandocMonad m => MarkdownParser m (F Blocks)
10771079plain = fmap B.plain . trimInlinesF <$> inlines1