From f76b4fc497706c4939c51138384ac1414b6f8b08 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal <jrosenthal@jhu.edu> Date: Thu, 21 Dec 2017 11:45:08 -0500 Subject: [PATCH] PowerPoint writer: Register notes to state. When we encounter a note, we write it to the state directory of notes, and input a superscript. --- src/Text/Pandoc/Writers/Powerpoint.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Text/Pandoc/Writers/Powerpoint.hs b/src/Text/Pandoc/Writers/Powerpoint.hs index 6f83b5976..4a6f6a341 100644 --- a/src/Text/Pandoc/Writers/Powerpoint.hs +++ b/src/Text/Pandoc/Writers/Powerpoint.hs @@ -353,6 +353,14 @@ inlineToParElems (Code _ str) = do inlineToParElems $ Str str inlineToParElems (Math mathtype str) = return [MathElem mathtype (TeXString str)] +inlineToParElems (Note blks) = do + notes <- gets stNoteIds + let maxNoteId = case M.keys notes of + [] -> 0 + lst -> maximum lst + curNoteId = maxNoteId + 1 + modify $ \st -> st { stNoteIds = M.insert curNoteId blks notes } + inlineToParElems $ Superscript [Str $ show curNoteId] inlineToParElems (Span _ ils) = concatMapM inlineToParElems ils inlineToParElems (RawInline _ _) = return [] inlineToParElems _ = return []