@@ -477,17 +477,17 @@ linkToInlinesF linkStr =
477477
478478internalLink :: Text -> Inlines -> F Inlines
479479internalLink link title = do
480− anchorB <- (link `elem`) <$> asksF orgStateAnchorIds
481− if anchorB
480+ ids <- asksF orgStateAnchorIds
481+ if link `elem` ids
482482 then return $ B.link ("#" <> link) "" title
483− else return $ B.emph title
483+ else let attr' = ("", ["spurious-link"] , [("target", link)])
484+ in return $ B.spanWith attr' (B.emph title)
484485
485486-- | Parse an anchor like @<<anchor-id>>@ and return an empty span with
486487-- @anchor-id@ set as id. Legal anchors in org-mode are defined through
487488-- @org-target-regexp@, which is fairly liberal. Since no link is created if
488489-- @anchor-id@ contains spaces, we are more restrictive in what is accepted as
489490-- an anchor.
490−
491491anchor :: PandocMonad m => OrgParser m (F Inlines)
492492anchor = try $ do
493493 anchorId <- parseAnchor
@@ -501,7 +501,6 @@ anchor = try $ do
501501
502502-- | Replace every char but [a-zA-Z0-9_.-:] with a hyphen '-'. This mirrors
503503-- the org function @org-export-solidify-link-text@.
504−
505504solidify :: Text -> Text
506505solidify = T.map replaceSpecialChar
507506 where replaceSpecialChar c