git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #1912 from zudov/missing_alt

Fixed issue #1131 + small refactoring

commit5073758bb89cbbba00d525b78282d407a978efb5 authorMatthew Pickering <matthewtpickering@gmail.com> dateFri 30 Jan 2015, 00:35 (12 years ago) parent82c04a292e762c
1 file changed+3−10
src/Text/Pandoc/Writers/HTML.hs+3−10
src/Text/Pandoc/Writers/HTML.hs+3−10
@@ -785,22 +785,15 @@ 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] ++
790− (if null tit
791− then []
792− else [A.title $ toValue tit]) ++
793− if null txt
794− then []
795− else [A.alt $ toValue alternate']
789+ [A.title $ toValue tit | not $ null tit] ++
790+ [A.alt $ toValue $ stringify txt]
796791 let tag = if writerHtml5 opts then H5.img else H.img
797792 return $ foldl (!) tag attributes
798793 -- note: null title included, as in Markdown.pl
799794 (Image _ (s,tit)) -> do
800795 let attributes = [A.src $ toValue s] ++
801− (if null tit
802− then []
803− else [A.title $ toValue tit])
796+ [A.title $ toValue tit | not $ null tit]
804797 return $ foldl (!) H5.embed attributes
805798 -- note: null title included, as in Markdown.pl
806799 (Note contents)