mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-27 10:46:33 +00:00
LaTeX reader: Add "fig:" as title for images with captions.
This is needed for them to be rendered as figures. Closes #766.
This commit is contained in:
@@ -500,13 +500,17 @@ inlineCommands = M.fromList $
|
||||
mkImage :: String -> LP Inlines
|
||||
mkImage src = do
|
||||
-- try for a caption
|
||||
alt <- option (str "image") $ try $ spaces >>
|
||||
controlSeq "caption" >> optional (char '*') >> grouped inline
|
||||
(alt, tit) <- option (str "image", "") $ try $ do
|
||||
spaces
|
||||
controlSeq "caption"
|
||||
optional (char '*')
|
||||
ils <- grouped inline
|
||||
return (ils, "fig:")
|
||||
case takeExtension src of
|
||||
"" -> do
|
||||
defaultExt <- getOption readerDefaultImageExtension
|
||||
return $ image (addExtension src defaultExt) "" alt
|
||||
_ -> return $ image src "" alt
|
||||
return $ image (addExtension src defaultExt) tit alt
|
||||
_ -> return $ image src tit alt
|
||||
|
||||
inNote :: Inlines -> Inlines
|
||||
inNote ils =
|
||||
|
||||
Reference in New Issue
Block a user