mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-29 01:41:20 +08:00
Also escape % in URLs.
This improves the fix to #9017 in commit
7c4354646b
An alternative would be to avoid backslash escaping `#` and `%`
in URLs, and instead always add `fragile` to the slide environment.
This commit is contained in:
@@ -94,9 +94,12 @@ stringToLaTeX context zs = do
|
||||
in case x of
|
||||
'\\'| isUrl -> emitc '/' -- NB. / works as path sep even on Windows
|
||||
'#' | isUrl -> emits "\\#" -- see #9014
|
||||
'%' | isUrl -> emits "\\%" -- see #9014
|
||||
c | isUrl ->
|
||||
if c `elem` ['{', '}', '|', '^', '~', '[', ']', '`']
|
||||
then emits (escapeURIString (const False) [c])
|
||||
then do
|
||||
emitc '\\' -- escape the % see #9014
|
||||
emits (escapeURIString (const False) [c])
|
||||
else emitc c
|
||||
'{' -> emits "\\{"
|
||||
'}' -> emits "\\}"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
^D
|
||||
\url{https://example.com/foo-bar}
|
||||
\url{https://example.com/foo--bar}
|
||||
\url{https://example.com/foo%2Dbar}
|
||||
\url{https://example.com/foo%2D%2Dbar}
|
||||
\url{https://example.com/foo%2D%2Dbar}
|
||||
\url{https://example.com/foo\%2Dbar}
|
||||
\url{https://example.com/foo\%2D\%2Dbar}
|
||||
\url{https://example.com/foo\%2D\%2Dbar}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user