aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-09-16 11:20:53 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-09-16 11:20:53 -0700
commit1e2b20f8bc97965bbe98b318185b2b58a1d46845 (patch)
tree1441283df049b0997c3047f10990aeb86f87c560 /src/Text/Pandoc
parent23e1a25014a17d2fd8bf6bcdf080da36c0243a30 (diff)
downloadpandoc-1e2b20f8bc97965bbe98b318185b2b58a1d46845.tar.gz
LaTeX writer: Properly escape strings inside \url{}.
Closes #576.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 2b5c7e84b..54c112b09 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -577,7 +577,8 @@ inlineToLaTeX (Link txt (src, _)) =
case txt of
[Code _ x] | x == src -> -- autolink
do modify $ \s -> s{ stUrl = True }
- return $ text $ "\\url{" ++ x ++ "}"
+ src' <- stringToLaTeX True x
+ return $ text $ "\\url{" ++ src' ++ "}"
_ -> do contents <- inlineListToLaTeX txt
src' <- stringToLaTeX True src
return $ text ("\\href{" ++ src' ++ "}{") <>