@@ -477,17 +477,17 @@ linkToInlinesF linkStr =
478internalLink :: Text -> Inlines -> F Inlines
478internalLink :: Text -> Inlines -> F Inlines
479internalLink link title = do
479internalLink link title = do
480− anchorB <- (link `elem`) <$> asksF orgStateAnchorIds
480+ ids <- asksF orgStateAnchorIds
481− if anchorB
481+ if link `elem` ids
482 then return $ B.link ("#" <> link) "" title
482 then return $ B.link ("#" <> link) "" title
483+ else let attr' = ("", ["spurious-link"] , [("target", link)])
483− else return $ B.emph title
484+ in return $ B.spanWith attr' (B.emph title)
485-- | Parse an anchor like @<<anchor-id>>@ and return an empty span with
486-- | Parse an anchor like @<<anchor-id>>@ and return an empty span with
486-- @anchor-id@ set as id. Legal anchors in org-mode are defined through
487-- @anchor-id@ set as id. Legal anchors in org-mode are defined through
487-- @org-target-regexp@, which is fairly liberal. Since no link is created if
488-- @org-target-regexp@, which is fairly liberal. Since no link is created if
488-- @anchor-id@ contains spaces, we are more restrictive in what is accepted as
489-- @anchor-id@ contains spaces, we are more restrictive in what is accepted as
489-- an anchor.
490-- an anchor.
491anchor :: PandocMonad m => OrgParser m (F Inlines)
491anchor :: PandocMonad m => OrgParser m (F Inlines)
492anchor = try $ do
492anchor = try $ do
493 anchorId <- parseAnchor
493 anchorId <- parseAnchor
@@ -501,7 +501,6 @@ anchor = try $ do
502-- | Replace every char but [a-zA-Z0-9_.-:] with a hyphen '-'. This mirrors
502-- | Replace every char but [a-zA-Z0-9_.-:] with a hyphen '-'. This mirrors
503-- the org function @org-export-solidify-link-text@.
503-- the org function @org-export-solidify-link-text@.
505solidify :: Text -> Text
504solidify :: Text -> Text
506solidify = T.map replaceSpecialChar
505solidify = T.map replaceSpecialChar
507 where replaceSpecialChar c
506 where replaceSpecialChar c