@@ -455,13 +455,16 @@ elementToHtml mbparentlevel slideLevel opts
455455 let inDiv xs = Blk (RawBlock (Format "html") ("<div class=\""
456456 ++ fragmentClass ++ "\">")) :
457457 (xs ++ [Blk (RawBlock (Format "html") "</div>")])
458− innerContents <- mapM (elementToHtml (Just level) slideLevel opts)
459− $ if titleSlide
458+ let (titleBlocks, innerSecs) =
459+ if titleSlide
460460 -- title slides have no content of their own
461− then filter isSec elements
461+ then ([x | Blk x <- elements],
462+ filter isSec elements)
462463 else case splitBy isPause elements of
463− [] -> []
464− (x:xs) -> x ++ concatMap inDiv xs
464+ [] -> ([],[])
465+ (x:xs) -> ([],x ++ concatMap inDiv xs)
466+ titleContents <- blockListToHtml opts titleBlocks
467+ innerContents <- mapM (elementToHtml (Just level) slideLevel opts) innerSecs
465468 let inNl x = mconcat $ nl opts : intersperse (nl opts) x ++ [nl opts]
466469 let classes' = ["title-slide" | titleSlide] ++ ["slide" | slide] ++
467470 ["section" | (slide || writerSectionDivs opts) &&
@@ -474,8 +477,7 @@ elementToHtml mbparentlevel slideLevel opts
474477 let attr = (id',classes',keyvals)
475478 if titleSlide
476479 then do
477− t <- addAttrs opts attr $
478− secttag header'
480+ t <- addAttrs opts attr $ secttag $ header' <> titleContents
479481 return $
480482 (if slideVariant == RevealJsSlides && not (null innerContents)
481483 -- revealjs doesn't like more than one level of section nesting: