diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-01-27 13:44:17 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-01-27 13:44:17 -0800 |
commit | 513af8dd1bce76e37e813366347563284d9879b6 (patch) | |
tree | 0cd32996ffabb36dce89c42f032d78e081cf1fb6 /src/Text/Pandoc | |
parent | 5b3c0a10819a317cda5d6acaf2144a017bf55d75 (diff) | |
download | pandoc-513af8dd1bce76e37e813366347563284d9879b6.tar.gz |
LaTeX writer: escape # in href URLs. Closes #359.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 8 |
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{}") |