File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
src/Text/Pandoc/Readers/Org Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -474,15 +474,16 @@ figure = try $ do
474474 figCaption = fromMaybe mempty $ blockAttrCaption figAttrs
475475 figKeyVals = blockAttrKeyValues figAttrs
476476 attr = (figLabel, mempty , figKeyVals)
477- figTitle = (if isFigure then withFigPrefix else id ) figName
478- in
479- B. para . B. imageWith attr imgSrc figTitle <$> figCaption
480-
481- withFigPrefix :: Text -> Text
482- withFigPrefix cs =
483- if " fig:" `T.isPrefixOf` cs
484- then cs
485- else " fig:" <> cs
477+ in if isFigure
478+ then (\ c ->
479+ B. simpleFigureWith
480+ attr c imgSrc (unstackFig figName)) <$> figCaption
481+ else B. para . B. imageWith attr imgSrc figName <$> figCaption
482+ unstackFig :: Text -> Text
483+ unstackFig figName =
484+ if " fig:" `T.isPrefixOf` figName
485+ then T. drop 4 figName
486+ else figName
486487
487488-- | Succeeds if looking at the end of the current paragraph
488489endOfParagraph :: Monad m => OrgParser m ()
You can’t perform that action at this time.
0 commit comments