summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2023-08-23 08:04:57 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2023-08-23 08:04:57 -0700
commit7c4354646b57aa0d505dc955f856b8c3443c8db4 (patch)
tree268ebe1822c6dde52e38eeae7f50fc0f0a09cd77 /src
parent54b9eeb6a72f1c6f0ae3675cb9e7c29fa3183316 (diff)
LaTeX writer: backslash-escape # in URLs. Closes #9014.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX/Util.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX/Util.hs b/src/Text/Pandoc/Writers/LaTeX/Util.hs
index 98bb2a01f..f19f5ddd5 100644
--- a/src/Text/Pandoc/Writers/LaTeX/Util.hs
+++ b/src/Text/Pandoc/Writers/LaTeX/Util.hs
@@ -93,6 +93,7 @@ stringToLaTeX context zs = do
_ -> cs <> xs
in case x of
'\\'| isUrl -> emitc '/' -- NB. / works as path sep even on Windows
+ '#' | isUrl -> emits "\\#" -- see #9014
c | isUrl ->
if c `elem` ['{', '}', '|', '^', '~', '[', ']', '`']
then emits (escapeURIString (const False) [c])