git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: escape # in href URLs. Closes #359.
commit513af8dd1bce76e37e813366347563284d9879b6 authorJohn MacFarlane <fiddlosopher@gmail.com> dateFri 27 Jan 2012, 13:44 (15 years ago) parent5b3c0a1
1 file changed+2−6
src/Text/Pandoc/Writers/LaTeX.hs+2−6
src/Text/Pandoc/Writers/LaTeX.hs+2−6
@@ -171,12 +171,8 @@ elementToLaTeX opts (Sec level _ id' title' elements) = do
171171-- escape things as needed for LaTeX
172172stringToLaTeX :: Bool -> String -> String
173173stringToLaTeX isUrl = escapeStringUsing latexEscapes
174− where latexEscapes = backslashEscapes "{}$%&_" ++
175− if isUrl
176− then []
177− else [ ('~', "\\ensuremath{\\sim}")
178− , ('#', "\\#")
179− ] ++
174+ where latexEscapes = backslashEscapes "{}$%&_#" ++
175+ [ ('~', "\\ensuremath{\\sim}") | not isUrl ] ++
180176 [ ('^', "\\^{}")
181177 , ('\\', "\\textbackslash{}")
182178 , ('€', "\\euro{}")