@@ -105,10 +105,6 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do
105105 date <- if standalone
106106 then inlineListToHtml opts date'
107107 else return noHtml
108− let sects = hierarchicalize blocks
109− toc <- if writerTableOfContents opts
110− then tableOfContents opts sects
111− else return Nothing
112108 let startSlide = RawBlock "html" "<div class=\"slide\">\n"
113109 endSlide = RawBlock "html" "</div>\n"
114110 let cutUp (HorizontalRule : Header 1 ys : xs) = cutUp (Header 1 ys : xs)
@@ -123,10 +119,14 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do
123119 cutUp xs ++ [endSlide]
124120 _ -> [startSlide] ++ cutUp blocks ++
125121 [endSlide]
122+ let sects = if writerSlideVariant opts `elem` [SlidySlides, S5Slides]
123+ then hierarchicalize slides
124+ else hierarchicalize blocks
125+ toc <- if writerTableOfContents opts
126+ then tableOfContents opts sects
127+ else return Nothing
126128 blocks' <- liftM (toHtmlFromList . intersperse (nl opts)) $
127− if writerSlideVariant opts `elem` [SlidySlides, S5Slides]
128− then mapM (blockToHtml opts) slides
129− else mapM (elementToHtml opts) sects
129+ mapM (elementToHtml opts) sects
130130 st <- get
131131 let notes = reverse (stNotes st)
132132 let thebody = blocks' +++ footnoteSection opts notes
@@ -238,12 +238,12 @@ elementToHtml opts (Sec level num id' title' elements) = do
238238 modify $ \st -> st{stSecNum = num} -- update section number
239239 header' <- blockToHtml opts (Header level title')
240240 innerContents <- mapM (elementToHtml opts) elements
241− let slides = writerSlideVariant opts `elem` [SlidySlides, S5Slides]
241+ let s5 = writerSlideVariant opts == S5Slides
242242 let header'' = header' ! [prefixedId opts id' |
243243 not (writerStrictMarkdown opts ||
244− writerSectionDivs opts || slides)]
244+ writerSectionDivs opts || s5)]
245245 let stuff = header'' : innerContents
246− return $ if slides -- S5 gets confused by the extra divs around sections
246+ return $ if s5 -- S5 gets confused by the extra divs around sections
247247 then toHtmlFromList $ intersperse (nl opts) stuff
248248 else if writerSectionDivs opts
249249 then if writerHtml5 opts