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