RST writer: Properly handle images with no alt text.

Closes #678.
This commit is contained in:
John MacFarlane 2013-01-13 20:24:34 -08:00
parent cc9fb46fa6
commit f191aa4a98

View file

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