aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorAner Lucero <4rgento@gmail.com>2021-06-29 08:49:36 -0300
committerJohn MacFarlane <jgm@berkeley.edu>2021-06-29 09:02:13 -0700
commitf4ef652a4165fefe4b587882cc75d1e24971ef1f (patch)
treed424056bfc159aa2cff7018facba8b36f3f122a3 /src/Text/Pandoc
parent382be73d77eca007a6d333391159123235fe3561 (diff)
downloadpandoc-f4ef652a4165fefe4b587882cc75d1e24971ef1f.tar.gz
Remove duplicated alt text in HTML output.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index b99b1a413..df01fc35f 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -1433,7 +1433,7 @@ inlineToHtml opts inline = do
return $ if T.null tit
then link'
else link' ! A.title (toValue tit)
- (Image attr txt (s,tit)) -> do
+ (Image attr@(_, _, attrList) txt (s, tit)) -> do
let alternate = stringify txt
slideVariant <- gets stSlideVariant
let isReveal = slideVariant == RevealJsSlides
@@ -1446,7 +1446,8 @@ inlineToHtml opts inline = do
[A.title $ toValue tit | not (T.null tit)] ++
attrs
imageTag = (if html5 then H5.img else H.img
- , [A.alt $ toValue alternate | not (null txt)] )
+ , [A.alt $ toValue alternate | not (null txt) &&
+ isNothing (lookup "alt" attrList)] )
mediaTag tg fallbackTxt =
let linkTxt = if null txt
then fallbackTxt