diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2015-01-30 00:35:16 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2015-01-30 00:35:16 +0000 |
commit | 5073758bb89cbbba00d525b78282d407a978efb5 (patch) | |
tree | 0eefd9822bf8e2b5b25e42714d0625dba0436ed6 /src/Text | |
parent | 82c04a28cee407b0fcf56224b6c63d014e2c1c39 (diff) | |
parent | 92e762c2d63335639f1ddb2df901fac396db74a1 (diff) | |
download | pandoc-5073758bb89cbbba00d525b78282d407a978efb5.tar.gz |
Merge pull request #1912 from zudov/missing_alt
Fixed issue #1131 + small refactoring
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 955c1b208..e38d66216 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -785,22 +785,15 @@ inlineToHtml opts inline = then link' else link' ! A.title (toValue tit) (Image txt (s,tit)) | treatAsImage s -> do - let alternate' = stringify txt let attributes = [A.src $ toValue s] ++ - (if null tit - then [] - else [A.title $ toValue tit]) ++ - if null txt - then [] - else [A.alt $ toValue alternate'] + [A.title $ toValue tit | not $ null tit] ++ + [A.alt $ toValue $ stringify txt] let tag = if writerHtml5 opts then H5.img else H.img return $ foldl (!) tag attributes -- note: null title included, as in Markdown.pl (Image _ (s,tit)) -> do let attributes = [A.src $ toValue s] ++ - (if null tit - then [] - else [A.title $ toValue tit]) + [A.title $ toValue tit | not $ null tit] return $ foldl (!) H5.embed attributes -- note: null title included, as in Markdown.pl (Note contents) |