aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-03-18 16:41:06 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-03-18 16:41:06 -0700
commitc57649956d94f47f37c85b58be6978b2f989acae (patch)
treee142b5f4378717d7ae96c541162ed35c73e636c9 /src/Text/Pandoc
parent3880a23de9004748319bdf3ecced676d6e5b2ea0 (diff)
downloadpandoc-c57649956d94f47f37c85b58be6978b2f989acae.tar.gz
Improve autolink detection in LaTeX reader.
This determines whether `\url` or `\href` is used. Closes #5340.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 87b161874..fd1606c41 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -1219,12 +1219,12 @@ inlineToLaTeX (Link _ txt ('#':ident, _)) = do
return $ text "\\protect\\hyperlink" <> braces (text lab) <> braces contents
inlineToLaTeX (Link _ txt (src, _)) =
case txt of
- [Str x] | escapeURI x == src -> -- autolink
+ [Str x] | x == unEscapeString src -> -- autolink
do modify $ \s -> s{ stUrl = True }
src' <- stringToLaTeX URLString (escapeURI src)
return $ text $ "\\url{" ++ src' ++ "}"
[Str x] | Just rest <- stripPrefix "mailto:" src,
- escapeURI x == rest -> -- email autolink
+ x == unEscapeString rest -> -- email autolink
do modify $ \s -> s{ stUrl = True }
src' <- stringToLaTeX URLString (escapeURI src)
contents <- inlineListToLaTeX txt