git.iko.soy/typeable/pandoc
on master help sign in
Do not ommit missing `alt` attribute on `img` tag

Fixes #1131

commitb5cc01e9765e37cb8367a00a0b1a6b8af57cc9e5 authorKonstantin Zudov <konstantin@anche.no> dateThu 29 Jan 2015, 22:09 (12 years ago) parent82c04a2
1 file changed+1−4
src/Text/Pandoc/Writers/HTML.hs+1−4
src/Text/Pandoc/Writers/HTML.hs+1−4
@@ -785,14 +785,11 @@ inlineToHtml opts inline =
785785 then link'
786786 else link' ! A.title (toValue tit)
787787 (Image txt (s,tit)) | treatAsImage s -> do
788− let alternate' = stringify txt
789788 let attributes = [A.src $ toValue s] ++
790789 (if null tit
791790 then []
792791 else [A.title $ toValue tit]) ++
793− if null txt
794− then []
795− else [A.alt $ toValue alternate']
792+ [A.alt $ toValue $ stringify txt]
796793 let tag = if writerHtml5 opts then H5.img else H.img
797794 return $ foldl (!) tag attributes
798795 -- note: null title included, as in Markdown.pl