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.
This commit is contained in:
Jesse Rosenthal 2019-03-30 22:44:55 -04:00
parent 79c82a2550
commit dda5f0a572

View file

@ -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)