aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2018-02-17 14:46:42 -0500
committerJesse Rosenthal <jrosenthal@jhu.edu>2018-02-18 16:31:32 -0500
commit47a399303dbef997450f4a07b4f7c8b20bf6fb66 (patch)
tree280e26388eded5ca01d98bfa689793ac073f3eea /src
parenteace2357dde61bebbd7b93d6f4073620353a384a (diff)
downloadpandoc-47a399303dbef997450f4a07b4f7c8b20bf6fb66.tar.gz
Powerpoint writer: modify speaker notes in presentation.xml
We remove the `notesMasterIdLst` entry in `presentation.xml` if there no speaker notes in the presentation.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint/Output.hs13
1 files changed, 12 insertions, 1 deletions
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}