diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-07-14 09:04:17 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-07-14 09:04:17 -0700 |
commit | 851c5e6ae28f616e38159bae7d57ea25483c4b4e (patch) | |
tree | 537620bf95edf3fb61b4f96bdd01a94ce89fe198 /src/Text | |
parent | 255aa7eb6e7f7176d3b7f339cb8035bc27a343af (diff) | |
download | pandoc-851c5e6ae28f616e38159bae7d57ea25483c4b4e.tar.gz |
Code cleanup, S5 writer.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/S5.hs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/Text/Pandoc/Writers/S5.hs b/src/Text/Pandoc/Writers/S5.hs index 1a2639a50..3723626c2 100644 --- a/src/Text/Pandoc/Writers/S5.hs +++ b/src/Text/Pandoc/Writers/S5.hs @@ -107,19 +107,11 @@ isH1 _ = False -- | Insert HTML around sections to make individual slides. insertSlides :: Bool -> [Block] -> [Block] insertSlides beginning blocks = - let (beforeHead, rest) = break isH1 blocks in - if (null rest) then - if beginning then - beforeHead - else - beforeHead ++ [slideEnd] - else - if beginning then - beforeHead ++ - slideStart:(head rest):(insertSlides False (tail rest)) - else - beforeHead ++ - slideEnd:slideStart:(head rest):(insertSlides False (tail rest)) + let (beforeHead, rest) = break isH1 blocks + in case rest of + [] -> beforeHead ++ [slideEnd | not beginning] + (h:t) -> beforeHead ++ [slideEnd | not beginning] ++ + (slideStart : h : insertSlides False t) -- | Insert blocks into 'Pandoc' for slide structure. insertS5Structure :: Pandoc -> Pandoc |