From 0d99a131b179b1e298718533af54940d9bc431e1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 6 Jan 2022 10:56:33 -0800 Subject: [PATCH] reveal.js: Make sure images with r-stretch are not in p tags. They must be direct children of the section. There was previously code to make this work with the older class name `stretch`. See https://github.com/jgm/pandoc/issues/5965#issuecomment-1006623836 --- src/Text/Pandoc/Writers/HTML.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index a07847913..988fc26bd 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -744,7 +744,7 @@ blockToHtmlInner :: PandocMonad m => WriterOptions -> Block -> StateT WriterStat blockToHtmlInner _ Null = return mempty blockToHtmlInner opts (Plain lst) = inlineListToHtml opts lst blockToHtmlInner opts (Para [Image attr@(_,classes,_) txt (src,tit)]) - | "stretch" `elem` classes = do + | "r-stretch" `elem` classes = do slideVariant <- gets stSlideVariant case slideVariant of RevealJsSlides -> @@ -1590,8 +1590,9 @@ blockListToNote opts ref blocks = do else let lastBlock = last blocks otherBlocks = init blocks in case lastBlock of - Para [Image _ _ (_,tit)] + Para [Image (_,cls,_) _ (_,tit)] | "fig:" `T.isPrefixOf` tit + || "r-stretch" `elem` cls -> otherBlocks ++ [lastBlock, Plain backlink] Para lst -> otherBlocks ++