aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2019-03-30 22:44:55 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2019-03-30 22:44:55 -0400
commitdda5f0a572c4742c675ae277edd6317cf24cb568 (patch)
tree0b24de74f30ea8291e0ac2edf422a5fca032c91e /src/Text
parent79c82a2550977e391ca60820b6013d23d444bf39 (diff)
downloadpandoc-dda5f0a572c4742c675ae277edd6317cf24cb568.tar.gz
Pptx writer: Correctly handle notes after section-title header
Previously, if notes came after a section-title header (ie, a level-1 header in a slide-level=2 presentation), they would go on the next slide. This keeps them on the slide with the header.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint/Presentation.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
index b1cf8edc5..fff5ca1e3 100644
--- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
@@ -575,10 +575,11 @@ splitBlocks' cur acc (HorizontalRule : blks) =
splitBlocks' [] (acc ++ (if null cur then [] else [cur])) blks
splitBlocks' cur acc (h@(Header n _ _) : blks) = do
slideLevel <- asks envSlideLevel
+ let (nts, blks') = span isNotesDiv blks
case compare n slideLevel of
- LT -> splitBlocks' [] (acc ++ (if null cur then [] else [cur]) ++ [[h]]) blks
- EQ -> splitBlocks' [h] (acc ++ (if null cur then [] else [cur])) blks
- GT -> splitBlocks' (cur ++ [h]) acc blks
+ LT -> splitBlocks' [] (acc ++ (if null cur then [] else [cur]) ++ [h : nts]) blks'
+ EQ -> splitBlocks' (h:nts) (acc ++ (if null cur then [] else [cur])) blks'
+ GT -> splitBlocks' (cur ++ (h:nts)) acc blks'
-- `blockToParagraphs` treats Plain and Para the same, so we can save
-- some code duplication by treating them the same here.
splitBlocks' cur acc (Plain ils : blks) = splitBlocks' cur acc (Para ils : blks)