LaTeX writer: escape # in href URLs. Closes #359.

This commit is contained in:
John MacFarlane 2012-01-27 13:44:17 -08:00
parent 5b3c0a1081
commit 513af8dd1b

View file

@ -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{}")