git.iko.soy/typeable/pandoc
on master help sign in
Slidy writer: Avoid spurious blank page.
commit5fd13892634b70c83ac4873e97f983bd3e491638 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 22 Jul 2010, 17:28 (16 years ago) parenta3051b8
1 file changed+5−1
src/Text/Pandoc/Writers/HTML.hs+5−1
src/Text/Pandoc/Writers/HTML.hs+5−1
@@ -112,10 +112,14 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do
112112 Header 1 ys : cutUp xs
113113 cutUp (x:xs) = x : cutUp xs
114114 cutUp [] = []
115+ let preamble = case blocks of
116+ (HorizontalRule : _) -> []
117+ (Header 1 _ : _) -> []
118+ _ -> [RawHtml "<div class=\"slide\">\n"]
115119 blocks' <- liftM toHtmlFromList $
116120 case writerSlideVariant opts of
117121 SlidySlides -> mapM (blockToHtml opts) $
118− RawHtml "<div class=\"slide\">\n" :
122+ preamble ++
119123 cutUp blocks ++
120124 [RawHtml "</div>"]
121125 _ -> mapM (elementToHtml opts) sects