diff options
| author | John MacFarlane <fiddlosopher@gmail.com> | 2012-09-15 20:42:24 -0700 |
|---|---|---|
| committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-09-15 20:43:36 -0700 |
| commit | d9e34ce34db194f82a0910016174d7d88c2f6eeb (patch) | |
| tree | 04b6ca631d20561440ecbc6758959223039e2f46 | |
| parent | fc4ae15337ec461f2dbc0eed4701598e012a2151 (diff) | |
| download | pandoc-d9e34ce34db194f82a0910016174d7d88c2f6eeb.tar.gz | |
LaTeX writer: don't escape _ in url.
| -rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 2 | ||||
| -rw-r--r-- | tests/writer.latex | 2 |
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} |
