LaTeX writer: Properly escape strings inside \url{}.

Closes #576.
This commit is contained in:
John MacFarlane 2012-09-16 11:20:53 -07:00
parent 23e1a25014
commit 1e2b20f8bc
2 changed files with 3 additions and 2 deletions

View file

@ -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' ++ "}{") <>

View file

@ -834,7 +834,7 @@ Here's an \href{/script?foo=1\&bar=2}{inline link in pointy braces}.
\subsection{Autolinks}
With an ampersand: \url{http://example.com/?foo=1&bar=2}
With an ampersand: \url{http://example.com/?foo=1\&bar=2}
\begin{itemize}
\item