aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs4
-rw-r--r--tests/writer.latex10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index fbf443a03..836e0f974 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -370,8 +370,8 @@ inlineToLaTeX (Link txt (src, _)) =
do modify $ \s -> s{ stUrl = True }
return $ text $ "\\url{" ++ x ++ "}"
_ -> do contents <- inlineListToLaTeX $ deVerb txt
- return $ text ("\\href{" ++ src ++ "}{") <> contents <>
- char '}'
+ return $ text ("\\href{" ++ stringToLaTeX src ++ "}{") <>
+ contents <> char '}'
inlineToLaTeX (Image _ (source, _)) = do
modify $ \s -> s{ stGraphics = True }
return $ "\\includegraphics" <> braces (text source)
diff --git a/tests/writer.latex b/tests/writer.latex
index 374815f63..eb4012749 100644
--- a/tests/writer.latex
+++ b/tests/writer.latex
@@ -581,7 +581,7 @@ spaces: a\^{}b c\^{}d, a\ensuremath{\sim}b c\ensuremath{\sim}d.
`He said, ``I want to go.''\,' Were you alive in the 70's?
Here is some quoted `\verb!code!' and a
-``\href{http://example.com/?foo=1&bar=2}{quoted link}''.
+``\href{http://example.com/?foo=1\&bar=2}{quoted link}''.
Some dashes: one---two --- three---four --- five.
@@ -711,7 +711,7 @@ Just a \href{/url/}{URL}.
\href{/url/}{URL and title}
-\href{/url/with_underscore}{with\_underscore}
+\href{/url/with\_underscore}{with\_underscore}
\href{mailto:nobody@nowhere.net}{Email link}
@@ -746,15 +746,15 @@ Foo \href{/url/}{biz}.
\subsection{With ampersands}
-Here's a \href{http://example.com/?foo=1&bar=2}{link with an ampersand in the
+Here's a \href{http://example.com/?foo=1\&bar=2}{link with an ampersand in the
URL}.
Here's a link with an amersand in the link text:
\href{http://att.com/}{AT\&T}.
-Here's an \href{/script?foo=1&bar=2}{inline link}.
+Here's an \href{/script?foo=1\&bar=2}{inline link}.
-Here's an \href{/script?foo=1&bar=2}{inline link in pointy braces}.
+Here's an \href{/script?foo=1\&bar=2}{inline link in pointy braces}.
\subsection{Autolinks}