git.iko.soy/typeable/pandoc
on master help sign in
Powerpoint writer: modify speaker notes in presentation.xml

We remove the `notesMasterIdLst` entry in `presentation.xml` if there no speaker notes in the presentation.

commit47a399303dbef997450f4a07b4f7c8b20bf6fb66 authorJesse Rosenthal <jrosenthal@jhu.edu> dateSat 17 Feb 2018, 14:46 (9 years ago) parenteace235
1 file changed+12−1
src/Text/Pandoc/Writers/Powerpoint/Output.hs+12−1
src/Text/Pandoc/Writers/Powerpoint/Output.hs+12−1
@@ -1340,7 +1340,18 @@ presentationToPresentationElement pres = do
13401340 _ -> Elem e
13411341 modifySldIdLst ct = ct
13421342
1343− newContent = map modifySldIdLst $ elContent element
1343+ removeSpeakerNotes' :: Content -> [Content]
1344+ removeSpeakerNotes' (Elem e) = case elName e of
1345+ (QName "notesMasterIdLst" _ _) -> []
1346+ _ -> [Elem e]
1347+ removeSpeakerNotes' ct = [ct]
1348+
1349+ removeSpeakerNotes :: [Content] -> [Content]
1350+ removeSpeakerNotes = if not (hasSpeakerNotes pres)
1351+ then concatMap removeSpeakerNotes'
1352+ else id
1353+
1354+ newContent = removeSpeakerNotes $ map modifySldIdLst $ elContent element
13441355
13451356 return $ element{elContent = newContent}
13461357