aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-01-26 14:01:50 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-01-26 14:01:50 -0800
commit2f50406c7f5cd34a7165f238cdeaceb53d32ed48 (patch)
tree0b1888eee29525c59fa6e2774fcb22d9793753ce /src/Text/Pandoc/Writers
parent412863df7f8e462e4d64ab6f45de7de083147534 (diff)
downloadpandoc-2f50406c7f5cd34a7165f238cdeaceb53d32ed48.tar.gz
Markdown writer: Use autolink when link text matches url.
Previously we also checked for a null title, but this test fails for links produced by citeproc-hs in bibliographies. So, if the link has a title, it will be lost on conversion to an autolink, but that seems okay.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 10d7d1ed2..6af32e7e5 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -644,9 +644,9 @@ inlineToMarkdown opts (Link txt (src, tit)) = do
then empty
else text $ " \"" ++ tit ++ "\""
let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
- let useAuto = case (tit,txt) of
- ("", [Str s]) | escapeURI s == srcSuffix -> True
- _ -> False
+ let useAuto = case txt of
+ [Str s] | escapeURI s == srcSuffix -> True
+ _ -> False
let useRefLinks = writerReferenceLinks opts && not useAuto
ref <- if useRefLinks then getReference txt (src, tit) else return []
reftext <- inlineListToMarkdown opts ref