diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-04-29 14:20:19 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-04-29 14:21:56 -0700 |
commit | deb72b5f43949fabaa7d20137259572042997fbf (patch) | |
tree | fb41d962119c4581cec8b3def4b7582a31db13a9 /src/Text | |
parent | a9f037a61591391066b7a51f7e1d263a1db66235 (diff) | |
download | pandoc-deb72b5f43949fabaa7d20137259572042997fbf.tar.gz |
ConTeXt writer: Fixed escaping of `%`.
* In text, `%` needs to be escaped as `\letterpercent`, not `\%`
* Inside URLs, `%` needs to be escaped as `\%`
Thanks to jmarca and adityam for the fix. Closes #492.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/ConTeXt.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index b612b9904..9cca76ada 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -95,7 +95,7 @@ escapeCharForConTeXt ch = '$' -> "\\$" '|' -> "\\letterbar{}" '^' -> "\\letterhat{}" - '%' -> "\\%" + '%' -> "\\letterpercent " '~' -> "\\lettertilde{}" '&' -> "\\&" '#' -> "\\#" @@ -298,7 +298,7 @@ inlineToConTeXt (Link txt (src, _)) = do label <- inlineListToConTeXt txt return $ "\\useURL" <> brackets (text ref) - <> brackets (text $ escapeStringUsing [('#',"\\#")] src) + <> brackets (text $ escapeStringUsing [('#',"\\#"),('%',"\\%")] src) <> brackets empty <> brackets label <> "\\from" |