@@ -388,10 +388,11 @@ registerImage alt (src,tit) mbtarget = do
388388 pics <- get >>= return . stImages
389389 txt <- case lookup alt pics of
390390 Just (s,t,mbt) | (s,t,mbt) == (src,tit,mbtarget) -> return alt
391− _ | null alt || alt == [Str ""] -> return
392− [Str $ "image" ++ show (length pics)]
393− | otherwise -> do
394− modify $ \st -> st { stImages =
395− (alt, (src,tit, mbtarget)):stImages st }
396− return alt
391+ _ -> do
392+ let alt' = if null alt || alt == [Str ""]
393+ then [Str $ "image" ++ show (length pics)]
394+ else alt
395+ modify $ \st -> st { stImages =
396+ (alt', (src,tit, mbtarget)):stImages st }
397+ return alt'
397398 inlineListToRST txt