@@ -36,6 +36,7 @@ import Text.Pandoc.Options
3636import Text.Pandoc.Shared
3737import Text.Pandoc.Templates (renderTemplate)
3838import Data.List ( isPrefixOf, intersperse, transpose )
39+import Network.URI (isAbsoluteURI)
3940import Text.Pandoc.Pretty
4041import Control.Monad.State
4142import Control.Applicative ( (<$>) )
@@ -364,9 +365,10 @@ inlineToRST (LineBreak) = return cr -- there's no line break in RST (see Para)
364365inlineToRST Space = return space
365366-- autolink
366367inlineToRST (Link [Str str] (src, _))
367− | if "mailto:" `isPrefixOf` src
368− then src == escapeURI ("mailto:" ++ str)
369− else src == escapeURI str = do
368+ | isAbsoluteURI src &&
369+ if "mailto:" `isPrefixOf` src
370+ then src == escapeURI ("mailto:" ++ str)
371+ else src == escapeURI str = do
370372 let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
371373 return $ text srcSuffix
372374inlineToRST (Link [Image alt (imgsrc,imgtit)] (src, _tit)) = do