diff options
| author | John MacFarlane <[email protected]> | 2022-01-06 10:56:33 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-01-06 10:56:33 -0800 |
| commit | 0d99a131b179b1e298718533af54940d9bc431e1 (patch) | |
| tree | 2a787a68bdb76a2bbbfc6278d2da2cbbce9dfc24 /src | |
| parent | 517d7a9cd3ebb5c63294540275cdd06c5f675ef9 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 5 |
1 files 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 ++ |
