Skip to content

Commit 9ef29f9

Browse files
committed
Keep image title
1 parent 7020dbe commit 9ef29f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Text/Pandoc/CrossRef/References/Blocks.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ replaceBlocks opts (Div (label,_,attrs) [Plain [Image alt img]])
3939
f | isFormat "latex" f ->
4040
RawInline (Format "tex") ("\\label{"++label++"}") : alt
4141
_ -> applyTemplate idxStr alt $ figureTemplate opts
42-
return $ Para [Image alt' (fst img,"fig:")]
42+
return $ Para [Image alt' img]
4343
replaceBlocks opts (Div (label,_,attrs) [Plain [Math DisplayMath eq]])
4444
| "eq:" `isPrefixOf` label
4545
= case outFormat opts of
@@ -113,9 +113,9 @@ replaceBlocks opts
113113
replaceBlocks _ x = return x
114114

115115
divBlocks :: Block -> Block
116-
divBlocks (Para (Image alt img:c))
116+
divBlocks (Para (Image alt (img, title):c))
117117
| Just label <- getRefLabel "fig" c
118-
= Div (label,[],[]) [Plain [Image alt (fst img, "fig:")]]
118+
= Div (label,[],[]) [Plain [Image alt (img, "fig:" ++ title)]]
119119
divBlocks (Para (math@(Math DisplayMath _eq):c))
120120
| Just label <- getRefLabel "eq" c
121121
= Div (label,[],[]) [Plain [math]]

0 commit comments

Comments
 (0)