aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint/Presentation.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
index e68f5eb57..5ced4e8a8 100644
--- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
@@ -680,9 +680,12 @@ replaceAnchor :: PandocMonad m => ParaElem -> Pres m ParaElem
replaceAnchor (Run rProps s)
| Just (ExternalTarget ('#':anchor, _)) <- rLink rProps = do
anchorMap <- gets stAnchorMap
- return $ case M.lookup anchor anchorMap of
- Just n -> Run (rProps{rLink = Just $ InternalTarget n}) s
- Nothing -> Run rProps s
+ -- If the anchor is not in the anchormap, we just remove the
+ -- link.
+ let rProps' = case M.lookup anchor anchorMap of
+ Just n -> rProps{rLink = Just $ InternalTarget n}
+ Nothing -> rProps{rLink = Nothing}
+ return $ Run rProps' s
replaceAnchor pe = return pe
blocksToPresentation :: PandocMonad m => [Block] -> Pres m Presentation