diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Slides.hs | 5 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 7 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Slides.hs b/src/Text/Pandoc/Slides.hs index c74e99279..fe9b60720 100644 --- a/src/Text/Pandoc/Slides.hs +++ b/src/Text/Pandoc/Slides.hs @@ -49,9 +49,10 @@ prepSlides :: Int -> [Block] -> [Block] prepSlides slideLevel = ensureStartWithH . splitHrule where splitHrule (HorizontalRule : Header n xs : ys) | n == slideLevel = Header slideLevel xs : splitHrule ys - splitHrule (HorizontalRule : xs) = Header slideLevel [] : splitHrule xs + splitHrule (HorizontalRule : xs) = Header slideLevel [Str "\0"] : + splitHrule xs splitHrule (x : xs) = x : splitHrule xs splitHrule [] = [] ensureStartWithH bs@(Header n _:_) | n <= slideLevel = bs - ensureStartWithH bs = Header slideLevel [] : bs + ensureStartWithH bs = Header slideLevel [Str "\0"] : bs diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 93ad6eb6e..b8474ee3f 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -262,7 +262,9 @@ elementToHtml slideLevel opts (Sec level num id' title' elements) = do -- always use level 1 for slide titles let level' = if slide then 1 else level let titleSlide = slide && level < slideLevel - header' <- blockToHtml opts (Header level' title') + header' <- if title' == [Str "\0"] -- marker for hrule + then return mempty + else blockToHtml opts (Header level' title') let isSec (Sec _ _ _ _ _) = True isSec (Blk _) = False innerContents <- mapM (elementToHtml slideLevel opts) diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 836ef1b50..7beee2d42 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -243,8 +243,11 @@ elementToBeamer slideLevel (Sec lvl _num _ident tit elts) let fragile = if not $ null $ queryWith hasCodeBlock elts ++ queryWith hasCode elts then "[fragile]" else "" - let slideStart = Para $ RawInline "latex" ("\\begin{frame}" ++ fragile ++ - "\\frametitle{") : tit ++ [RawInline "latex" "}"] + let slideStart = Para $ RawInline "latex" ("\\begin{frame}" ++ fragile) : + if tit == [Str "\0"] -- marker for hrule + then [] + else (RawInline "latex" "\\frametitle{") : tit ++ + [RawInline "latex" "}"] let slideEnd = RawBlock "latex" "\\end{frame}" -- now carve up slide into blocks if there are sections inside bs <- concat `fmap` mapM (elementToBeamer slideLevel) elts |