@@ -291,21 +291,21 @@ inlineToRST opts (TeX str) = return $ text str
291291inlineToRST opts (HtmlInline str) = return empty
292292inlineToRST opts (LineBreak) = return $ char ' ' -- RST doesn't have linebreaks
293293inlineToRST opts Space = return $ char ' '
294+inlineToRST opts (Link [Code str] (src, tit)) | src == str ||
295+ src == "mailto:" ++ str = do
296+ let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
297+ return $ text srcSuffix
294298inlineToRST opts (Link txt (src, tit)) = do
295299 let useReferenceLinks = writerReferenceLinks opts
296− let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
297− let useAuto = null tit && txt == [Str srcSuffix]
298− (notes, refs, pics) <- get
299300 linktext <- inlineListToRST opts $ normalizeSpaces txt
300− link <- if useReferenceLinks
301− then do let refs' = if (txt, (src, tit)) `elem` refs
302− then refs
303− else (txt, (src, tit)):refs
304− put (notes, refs', pics)
305− return $ char '`' <> linktext <> text "`_"
306− else return $ char '`' <> linktext <> text " <" <>
307− text src <> text ">`_"
308− return link
301+ if useReferenceLinks
302+ then do (notes, refs, pics) <- get
303+ let refs' = if (txt, (src, tit)) `elem` refs
304+ then refs
305+ else (txt, (src, tit)):refs
306+ put (notes, refs', pics)
307+ return $ char '`' <> linktext <> text "`_"
308+ else return $ char '`' <> linktext <> text " <" <> text src <> text ">`_"
309309inlineToRST opts (Image alternate (source, tit)) = do
310310 (notes, refs, pics) <- get
311311 let labelsUsed = map fst pics