@@ -268,11 +268,24 @@ elementToHtml slideLevel opts (Sec level num (id',classes,keyvals) title' elemen
268268 else blockToHtml opts (Header level' (id',classes,keyvals) title')
269269 let isSec (Sec _ _ _ _ _) = True
270270 isSec (Blk _) = False
271+ let isPause (Blk x) = x == Para [Str ".",Space,Str ".",Space,Str "."]
272+ isPause _ = False
273+ let fragmentClass = case writerSlideVariant opts of
274+ RevealJsSlides -> "fragment"
275+ _ -> "incremental"
276+ let inDiv xs = Blk (RawBlock (Format "html") ("<div class=\""
277+ ++ fragmentClass ++ "\">")) :
278+ (xs ++ [Blk (RawBlock (Format "html") "</div>")])
271279 innerContents <- mapM (elementToHtml slideLevel opts)
272280 $ if titleSlide
273281 -- title slides have no content of their own
274282 then filter isSec elements
275− else elements
283+ else if slide
284+ then case splitBy isPause elements of
285+ [] -> []
286+ [x] -> x
287+ xs -> concatMap inDiv xs
288+ else elements
276289 let inNl x = mconcat $ nl opts : intersperse (nl opts) x ++ [nl opts]
277290 let classes' = ["titleslide" | titleSlide] ++ ["slide" | slide] ++
278291 ["section" | (slide || writerSectionDivs opts) &&
@@ -401,10 +414,6 @@ blockToHtml opts (Para [Image txt (s,'f':'i':'g':':':tit)]) = do
401414 [nl opts, img, capt, nl opts]
402415 else H.div ! A.class_ "figure" $ mconcat
403416 [nl opts, img, capt, nl opts]
404−-- . . . indicates a pause in a slideshow
405−blockToHtml opts (Para [Str ".",Space,Str ".",Space,Str "."])
406− | writerSlideVariant opts == RevealJsSlides =
407− blockToHtml opts (RawBlock "html" "<div class=\"fragment\" />")
408417blockToHtml opts (Para lst) = do
409418 contents <- inlineListToHtml opts lst
410419 return $ H.p contents
@@ -580,8 +589,7 @@ toListItem opts item = nl opts >> H.li item
580589
581590blockListToHtml :: WriterOptions -> [Block] -> State WriterState Html
582591blockListToHtml opts lst =
583− mapM (blockToHtml opts) lst >>=
584− return . mconcat . intersperse (nl opts)
592+ fmap (mconcat . intersperse (nl opts)) $ mapM (blockToHtml opts) lst
585593
586594-- | Convert list of Pandoc inline elements to HTML.
587595inlineListToHtml :: WriterOptions -> [Inline] -> State WriterState Html