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
This commit is contained in:
John MacFarlane 2022-01-06 10:56:33 -08:00
parent 517d7a9cd3
commit 0d99a131b1

View file

@ -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 ++