git.iko.soy/typeable/pandoc
on master help sign in
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.

commit2f50406c7f5cd34a7165f238cdeaceb53d32ed48 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 26 Jan 2013, 14:01 (14 years ago) parent412863d
1 file changed+3−3
src/Text/Pandoc/Writers/Markdown.hs+3−3
src/Text/Pandoc/Writers/Markdown.hs+3−3
@@ -644,9 +644,9 @@ inlineToMarkdown opts (Link txt (src, tit)) = do
644644 then empty
645645 else text $ " \"" ++ tit ++ "\""
646646 let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
647− let useAuto = case (tit,txt) of
648− ("", [Str s]) | escapeURI s == srcSuffix -> True
649− _ -> False
647+ let useAuto = case txt of
648+ [Str s] | escapeURI s == srcSuffix -> True
649+ _ -> False
650650 let useRefLinks = writerReferenceLinks opts && not useAuto
651651 ref <- if useRefLinks then getReference txt (src, tit) else return []
652652 reftext <- inlineListToMarkdown opts ref