@@ -500,13 +500,17 @@ inlineCommands = M.fromList $
500500mkImage :: String -> LP Inlines
501501mkImage src = do
502502 -- try for a caption
503− alt <- option (str "image") $ try $ spaces >>
504− controlSeq "caption" >> optional (char '*') >> grouped inline
503+ (alt, tit) <- option (str "image", "") $ try $ do
504+ spaces
505+ controlSeq "caption"
506+ optional (char '*')
507+ ils <- grouped inline
508+ return (ils, "fig:")
505509 case takeExtension src of
506510 "" -> do
507511 defaultExt <- getOption readerDefaultImageExtension
508− return $ image (addExtension src defaultExt) "" alt
509− _ -> return $ image src "" alt
512+ return $ image (addExtension src defaultExt) tit alt
513+ _ -> return $ image src tit alt
510514
511515inNote :: Inlines -> Inlines
512516inNote ils =