git.iko.soy/typeable/pandoc
on master help sign in
Refactored `if x then [] else y` to `[y | not x]`
commit92e762c2d63335639f1ddb2df901fac396db74a1 authorKonstantin Zudov <konstantin@anche.no> dateThu 29 Jan 2015, 22:36 (12 years ago) parentb5cc01e
1 file changed+2−6
src/Text/Pandoc/Writers/HTML.hs+2−6
src/Text/Pandoc/Writers/HTML.hs+2−6
@@ -786,18 +786,14 @@ inlineToHtml opts inline =
786786 else link' ! A.title (toValue tit)
787787 (Image txt (s,tit)) | treatAsImage s -> do
788788 let attributes = [A.src $ toValue s] ++
789− (if null tit
790− then []
791− else [A.title $ toValue tit]) ++
789+ [A.title $ toValue tit | not $ null tit] ++
792790 [A.alt $ toValue $ stringify txt]
793791 let tag = if writerHtml5 opts then H5.img else H.img
794792 return $ foldl (!) tag attributes
795793 -- note: null title included, as in Markdown.pl
796794 (Image _ (s,tit)) -> do
797795 let attributes = [A.src $ toValue s] ++
798− (if null tit
799− then []
800− else [A.title $ toValue tit])
796+ [A.title $ toValue tit | not $ null tit]
801797 return $ foldl (!) H5.embed attributes
802798 -- note: null title included, as in Markdown.pl
803799 (Note contents)