aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-01-31 15:25:49 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2012-01-31 15:25:49 -0800
commit23ca68a5c41ef68397ed2217e31bf6e720fb0534 (patch)
tree36c1cdab069354b3777af79791884b55416c0698 /src
parente9a270d03b4eb1d7deb807d0bd2a940dde5c9fde (diff)
downloadpandoc-23ca68a5c41ef68397ed2217e31bf6e720fb0534.tar.gz
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>.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 5be6e67b1..8473f8ca4 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -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