@@ -953,17 +953,28 @@ inlineToHtml opts inline = do
953953 else link'' ! A.title (toValue tit)
954954 (Image attr txt (s,tit)) | treatAsImage s -> do
955955 let alternate' = stringify txt
956− let attributes = [A.src $ toValue s] ++
957− [A.title $ toValue tit | not (null tit)] ++
958− [A.alt $ toValue alternate' | not (null txt)] ++
959− imgAttrsToHtml opts attr
956+ slideVariant <- gets stSlideVariant
957+ let isReveal = slideVariant == RevealJsSlides
958+ let attributes =
959+ -- reveal.js uses data-src for lazy loading
960+ (if isReveal
961+ then customAttribute "data-src" $ toValue s
962+ else A.src $ toValue s) :
963+ [A.title $ toValue tit | not (null tit)] ++
964+ [A.alt $ toValue alternate' | not (null txt)] ++
965+ imgAttrsToHtml opts attr
960966 let tag = if html5 then H5.img else H.img
961967 return $ foldl (!) tag attributes
962968 -- note: null title included, as in Markdown.pl
963969 (Image attr _ (s,tit)) -> do
964− let attributes = [A.src $ toValue s] ++
965− [A.title $ toValue tit | not (null tit)] ++
966− imgAttrsToHtml opts attr
970+ slideVariant <- gets stSlideVariant
971+ let isReveal = slideVariant == RevealJsSlides
972+ let attributes =
973+ (if isReveal
974+ then customAttribute "data-src" $ toValue s
975+ else A.src $ toValue s) :
976+ [A.title $ toValue tit | not (null tit)] ++
977+ imgAttrsToHtml opts attr
967978 return $ foldl (!) H5.embed attributes
968979 -- note: null title included, as in Markdown.pl
969980 (Note contents) -> do