From dda5f0a572c4742c675ae277edd6317cf24cb568 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Sat, 30 Mar 2019 22:44:55 -0400 Subject: 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. --- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc') 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) -- cgit v1.2.3