@@ -618,7 +618,8 @@ propertiesDrawer = try $ do
618618-- Figures
619619--
620620
621−-- | Figures (Image on a line by itself, preceded by name and/or caption)
621+-- | Figures or an image paragraph (i.e. an image on a line by itself). Only
622+-- images with a caption attribute are interpreted as figures.
622623figure :: OrgParser (F Blocks)
623624figure = try $ do
624625 figAttrs <- blockAttributes
@@ -626,23 +627,24 @@ figure = try $ do
626627 case cleanLinkString src of
627628 Nothing -> mzero
628629 Just imgSrc -> do
629− guard (not . isNothing . blockAttrCaption $ figAttrs)
630630 guard (isImageFilename imgSrc)
631− return $ figureBlock figAttrs imgSrc
631+ let isFigure = not . isNothing $ blockAttrCaption figAttrs
632+ return $ imageBlock isFigure figAttrs imgSrc
632633 where
633634 selfTarget :: OrgParser String
634635 selfTarget = try $ char '[' *> linkTarget <* char ']'
635636
636− figureBlock :: BlockAttributes -> String -> (F Blocks)
637− figureBlock figAttrs imgSrc =
637+ imageBlock :: Bool -> BlockAttributes -> String -> F Blocks
638+ imageBlock isFigure figAttrs imgSrc =
638639 let
639640 figName = fromMaybe mempty $ blockAttrName figAttrs
640641 figLabel = fromMaybe mempty $ blockAttrLabel figAttrs
641642 figCaption = fromMaybe mempty $ blockAttrCaption figAttrs
642643 figKeyVals = blockAttrKeyValues figAttrs
643644 attr = (figLabel, mempty, figKeyVals)
645+ figTitle = (if isFigure then withFigPrefix else id) figName
644646 in
645− B.para . B.imageWith attr imgSrc (withFigPrefix figName) <$> figCaption
647+ B.para . B.imageWith attr imgSrc figTitle <$> figCaption
646648
647649 withFigPrefix :: String -> String
648650 withFigPrefix cs =