summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/LaTeX.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-01-27 13:44:17 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-01-27 13:44:17 -0800
commit513af8dd1bce76e37e813366347563284d9879b6 (patch)
tree0cd32996ffabb36dce89c42f032d78e081cf1fb6 /src/Text/Pandoc/Writers/LaTeX.hs
parent5b3c0a10819a317cda5d6acaf2144a017bf55d75 (diff)
LaTeX writer: escape # in href URLs. Closes #359.
Diffstat (limited to 'src/Text/Pandoc/Writers/LaTeX.hs')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index ce77184e8..dec6d3118 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -171,12 +171,8 @@ elementToLaTeX opts (Sec level _ id' title' elements) = do
-- escape things as needed for LaTeX
stringToLaTeX :: Bool -> String -> String
stringToLaTeX isUrl = escapeStringUsing latexEscapes
- where latexEscapes = backslashEscapes "{}$%&_" ++
- if isUrl
- then []
- else [ ('~', "\\ensuremath{\\sim}")
- , ('#', "\\#")
- ] ++
+ where latexEscapes = backslashEscapes "{}$%&_#" ++
+ [ ('~', "\\ensuremath{\\sim}") | not isUrl ] ++
[ ('^', "\\^{}")
, ('\\', "\\textbackslash{}")
, ('€', "\\euro{}")