diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-26 14:01:50 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-26 14:01:50 -0800 |
commit | 2f50406c7f5cd34a7165f238cdeaceb53d32ed48 (patch) | |
tree | 0b1888eee29525c59fa6e2774fcb22d9793753ce /src/Text/Pandoc/Writers | |
parent | 412863df7f8e462e4d64ab6f45de7de083147534 (diff) | |
download | pandoc-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.hs | 6 |
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 |