Don't let autolinks create reference links.

Previously we got bad results with -t markdown --reference-links
if the input contained autolinks like <http://yahoo.com>.
This commit is contained in:
John MacFarlane 2012-01-31 15:25:49 -08:00
parent e9a270d03b
commit 23ca68a5c4

View file

@ -498,10 +498,10 @@ 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 useRefLinks = writerReferenceLinks opts
let useAuto = case (tit,txt) of
("", [Code _ s]) | s == srcSuffix -> True
_ -> False
let useRefLinks = writerReferenceLinks opts && not useAuto
ref <- if useRefLinks then getReference txt (src, tit) else return []
reftext <- inlineListToMarkdown opts ref
return $ if useAuto