mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-25 17:56:32 +00:00
Remove duplicated alt text in HTML output.
This commit is contained in:
committed by
John MacFarlane
parent
382be73d77
commit
f4ef652a41
@@ -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
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
```
|
||||
% pandoc -f markdown -t html
|
||||
{alt="alt"}
|
||||
|
||||
^D
|
||||
<figure>
|
||||
<img src="../media/rId25.jpg" title="title" alt="alt" /><figcaption aria-hidden="true">caption</figcaption>
|
||||
</figure>
|
||||
```
|
||||
|
||||
```
|
||||
% pandoc -f markdown -t html
|
||||

|
||||
|
||||
^D
|
||||
<figure>
|
||||
<img src="../media/rId25.jpg" title="title" alt="caption" /><figcaption aria-hidden="true">caption</figcaption>
|
||||
</figure>
|
||||
```
|
||||
Reference in New Issue
Block a user