@@ -533,12 +533,10 @@ treatAsImage fp =
533 ext = map toLower $ drop 1 $ takeExtension path
533 ext = map toLower $ drop 1 $ takeExtension path
534 in null ext || ext `elem` imageExts
534 in null ext || ext `elem` imageExts
536−-- | Convert Pandoc block element to HTML.
536+figure :: PandocMonad m
537+ => WriterOptions -> Attr -> [Inline] -> (String, String)
537−blockToHtml :: PandocMonad m => WriterOptions -> Block -> StateT WriterState m Html
538+ -> StateT WriterState m Html
538−blockToHtml _ Null = return mempty
539−blockToHtml opts (Plain lst) = inlineListToHtml opts lst
540−-- title beginning with fig: indicates that the image is a figure
541−blockToHtml opts (Para [Image attr txt (s,'f':'i':'g':':':tit)]) = do
539+figure opts attr txt (s,tit) = do
542 img <- inlineToHtml opts (Image attr txt (s,tit))
540 img <- inlineToHtml opts (Image attr txt (s,tit))
543 html5 <- gets stHtml5
541 html5 <- gets stHtml5
544 let tocapt = if html5
542 let tocapt = if html5
@@ -552,6 +550,23 @@ blockToHtml opts (Para [Image attr txt (s,'f':'i':'g':':':tit)]) = do
552 [nl opts, img, capt, nl opts]
550 [nl opts, img, capt, nl opts]
553 else H.div ! A.class_ "figure" $ mconcat
551 else H.div ! A.class_ "figure" $ mconcat
554 [nl opts, img, nl opts, capt, nl opts]
552 [nl opts, img, nl opts, capt, nl opts]
554+-- | Convert Pandoc block element to HTML.
555+blockToHtml :: PandocMonad m => WriterOptions -> Block -> StateT WriterState m Html
556+blockToHtml _ Null = return mempty
557+blockToHtml opts (Plain lst) = inlineListToHtml opts lst
558+blockToHtml opts (Para [Image attr@(_,classes,_) txt (src,tit)])
559+ | "stretch" `elem` classes = do
560+ slideVariant <- gets stSlideVariant
561+ case slideVariant of
563+ -- a "stretched" image in reveal.js must be a direct child
564+ -- of the slide container
565+ inlineToHtml opts (Image attr txt (src, tit))
566+ _ -> figure opts attr txt (src, tit)
567+-- title beginning with fig: indicates that the image is a figure
568+blockToHtml opts (Para [Image attr txt (s,'f':'i':'g':':':tit)]) =
569+ figure opts attr txt (s,tit)
555blockToHtml opts (Para lst)
570blockToHtml opts (Para lst)
556 | isEmptyRaw lst = return mempty
571 | isEmptyRaw lst = return mempty
557 | otherwise = do
572 | otherwise = do