git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: don't escape _ in url.
commitd9e34ce34db194f82a0910016174d7d88c2f6eeb authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 15 Sep 2012, 20:42 (14 years ago) parentfc4ae15
2 files changed+2−2
src/Text/Pandoc/Writers/LaTeX.hs+1−1 tests/writer.latex+1−1
src/Text/Pandoc/Writers/LaTeX.hs+1−1
@@ -189,7 +189,7 @@ stringToLaTeX isUrl (x:xs) = do
189189 '$' -> "\\$" ++ rest
190190 '%' -> "\\%" ++ rest
191191 '&' -> "\\&" ++ rest
192− '_' -> "\\_" ++ rest
192+ '_' | not isUrl -> "\\_" ++ rest
193193 '#' -> "\\#" ++ rest
194194 '-' -> case xs of -- prevent adjacent hyphens from forming ligatures
195195 ('-':_) -> "-{}" ++ rest
tests/writer.latex+1−1
@@ -786,7 +786,7 @@ Just a \href{/url/}{URL}.
786786
787787\href{/url/}{URL and title}
788788
789−\href{/url/with\_underscore}{with\_underscore}
789+\href{/url/with_underscore}{with\_underscore}
790790
791791\href{mailto:nobody@nowhere.net}{Email link}
792792