From 47a399303dbef997450f4a07b4f7c8b20bf6fb66 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Sat, 17 Feb 2018 14:46:42 -0500 Subject: Powerpoint writer: modify speaker notes in presentation.xml We remove the `notesMasterIdLst` entry in `presentation.xml` if there no speaker notes in the presentation. --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 12b338b1c..1ed021086 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -1340,7 +1340,18 @@ presentationToPresentationElement pres = do _ -> Elem e modifySldIdLst ct = ct - newContent = map modifySldIdLst $ elContent element + removeSpeakerNotes' :: Content -> [Content] + removeSpeakerNotes' (Elem e) = case elName e of + (QName "notesMasterIdLst" _ _) -> [] + _ -> [Elem e] + removeSpeakerNotes' ct = [ct] + + removeSpeakerNotes :: [Content] -> [Content] + removeSpeakerNotes = if not (hasSpeakerNotes pres) + then concatMap removeSpeakerNotes' + else id + + newContent = removeSpeakerNotes $ map modifySldIdLst $ elContent element return $ element{elContent = newContent} -- cgit v1.2.3