Do not ommit missing alt attribute on img tag

Fixes #1131
This commit is contained in:
Konstantin Zudov 2015-01-29 22:09:35 +02:00
parent 82c04a28ce
commit b5cc01e976

View file

@ -785,14 +785,11 @@ inlineToHtml opts inline =
then link' then link'
else link' ! A.title (toValue tit) else link' ! A.title (toValue tit)
(Image txt (s,tit)) | treatAsImage s -> do (Image txt (s,tit)) | treatAsImage s -> do
let alternate' = stringify txt
let attributes = [A.src $ toValue s] ++ let attributes = [A.src $ toValue s] ++
(if null tit (if null tit
then [] then []
else [A.title $ toValue tit]) ++ else [A.title $ toValue tit]) ++
if null txt [A.alt $ toValue $ stringify txt]
then []
else [A.alt $ toValue alternate']
let tag = if writerHtml5 opts then H5.img else H.img let tag = if writerHtml5 opts then H5.img else H.img
return $ foldl (!) tag attributes return $ foldl (!) tag attributes
-- note: null title included, as in Markdown.pl -- note: null title included, as in Markdown.pl