git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: don't escape _ in url.
d9e34ceJohn MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+1−1
@@ -189,7 +189,7 @@ stringToLaTeX isUrl (x:xs) = do
189 '$' -> "\\$" ++ rest
189 '$' -> "\\$" ++ rest
190 '%' -> "\\%" ++ rest
190 '%' -> "\\%" ++ rest
191 '&' -> "\\&" ++ rest
191 '&' -> "\\&" ++ rest
192− '_' -> "\\_" ++ rest
192+ '_' | not isUrl -> "\\_" ++ rest
193 '#' -> "\\#" ++ rest
193 '#' -> "\\#" ++ rest
194 '-' -> case xs of -- prevent adjacent hyphens from forming ligatures
194 '-' -> case xs of -- prevent adjacent hyphens from forming ligatures
195 ('-':_) -> "-{}" ++ rest
195 ('-':_) -> "-{}" ++ rest
tests/writer.latex+1−1
@@ -786,7 +786,7 @@ Just a \href{/url/}{URL}.
786
786
787\href{/url/}{URL and title}
787\href{/url/}{URL and title}
788
788
789−\href{/url/with\_underscore}{with\_underscore}
789+\href{/url/with_underscore}{with\_underscore}
790
790
791\href{mailto:nobody@nowhere.net}{Email link}
791\href{mailto:nobody@nowhere.net}{Email link}
792
792