aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs2
-rw-r--r--tests/writer.latex2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 12ffecd98..1967e40dc 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -189,7 +189,7 @@ stringToLaTeX isUrl (x:xs) = do
'$' -> "\\$" ++ rest
'%' -> "\\%" ++ rest
'&' -> "\\&" ++ rest
- '_' -> "\\_" ++ rest
+ '_' | not isUrl -> "\\_" ++ rest
'#' -> "\\#" ++ rest
'-' -> case xs of -- prevent adjacent hyphens from forming ligatures
('-':_) -> "-{}" ++ rest
diff --git a/tests/writer.latex b/tests/writer.latex
index 3efc08277..bab23cd64 100644
--- a/tests/writer.latex
+++ b/tests/writer.latex
@@ -786,7 +786,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}