git.iko.soy/typeable/pandoc
on master help sign in
Powerpoint writer: Ignore anchor links to nowehere.
a7d131cJesse Rosenthal
src/Text/Pandoc/Writers/Powerpoint/Presentation.hs+6−3
@@ -680,9 +680,12 @@ replaceAnchor :: PandocMonad m => ParaElem -> Pres m ParaElem
680replaceAnchor (Run rProps s)
680replaceAnchor (Run rProps s)
681 | Just (ExternalTarget ('#':anchor, _)) <- rLink rProps = do
681 | Just (ExternalTarget ('#':anchor, _)) <- rLink rProps = do
682 anchorMap <- gets stAnchorMap
682 anchorMap <- gets stAnchorMap
683+ -- If the anchor is not in the anchormap, we just remove the
684+ -- link.
683− return $ case M.lookup anchor anchorMap of
685+ let rProps' = case M.lookup anchor anchorMap of
684− Just n -> Run (rProps{rLink = Just $ InternalTarget n}) s
686+ Just n -> rProps{rLink = Just $ InternalTarget n}
687+ Nothing -> rProps{rLink = Nothing}
685− Nothing -> Run rProps s
688+ return $ Run rProps' s
686replaceAnchor pe = return pe
689replaceAnchor pe = return pe
687
690
688blocksToPresentation :: PandocMonad m => [Block] -> Pres m Presentation
691blocksToPresentation :: PandocMonad m => [Block] -> Pres m Presentation