mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-26 02:06:32 +00:00
HTML writer: ensure that an alt attribute is added in EPUB output.
This seems to be required by iBooks; even an empty alt attribute will satisfy it. Closes #9354.
This commit is contained in:
@@ -1552,6 +1552,7 @@ inlineToHtml opts inline = do
|
||||
then link'
|
||||
else link' ! A.title (toValue tit)
|
||||
(Image attr@(_, _, attrList) txt (s, tit)) -> do
|
||||
epubVersion <- gets stEPUBVersion
|
||||
let alternate = stringify txt
|
||||
slideVariant <- gets stSlideVariant
|
||||
let isReveal = slideVariant == RevealJsSlides
|
||||
@@ -1564,8 +1565,9 @@ 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) &&
|
||||
isNothing (lookup "alt" attrList)] )
|
||||
, [A.alt $ toValue alternate |
|
||||
isNothing (lookup "alt" attrList) &&
|
||||
(isJust epubVersion || not (null txt))] )
|
||||
mediaTag tg fallbackTxt =
|
||||
let linkTxt = if null txt
|
||||
then fallbackTxt
|
||||
|
||||
Reference in New Issue
Block a user