@@ -659,17 +659,20 @@ dimensionsToAttrList attr = consolidateStyles $ go Width ++ go Height
659659figure :: PandocMonad m
660660 => WriterOptions -> Attr -> [Inline] -> (Text, Text)
661661 -> StateT WriterState m Html
662−figure opts attr txt (s,tit) = do
662+figure opts attr@(_, _, attrList) txt (s,tit) = do
663663 html5 <- gets stHtml5
664664 -- Screen-readers will normally read the @alt@ text and the figure; we
665665 -- want to avoid them reading the same text twice. With HTML5 we can
666666 -- use aria-hidden for the caption; with HTML4, we use an empty
667667 -- alt-text instead.
668+ -- When the alt text differs from the caption both should be read.
668669 let alt = if html5 then txt else [Str ""]
669670 let tocapt = if html5
670− then H5.figcaption !
671− H5.customAttribute (textTag "aria-hidden")
672− (toValue @Text "true")
671+ then (H5.figcaption !) $
672+ if isJust (lookup "alt" attrList)
673+ then mempty
674+ else H5.customAttribute (textTag "aria-hidden")
675+ (toValue @Text "true")
673676 else H.p ! A.class_ "caption"
674677 img <- inlineToHtml opts (Image attr alt (s,tit))
675678 capt <- if null txt