From 2f50406c7f5cd34a7165f238cdeaceb53d32ed48 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 26 Jan 2013 14:01:50 -0800 Subject: [PATCH] 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. --- src/Text/Pandoc/Writers/Markdown.hs | 6 +++--- 1 file 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