aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-04-29 14:20:19 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-04-29 14:21:56 -0700
commitdeb72b5f43949fabaa7d20137259572042997fbf (patch)
treefb41d962119c4581cec8b3def4b7582a31db13a9 /src/Text
parenta9f037a61591391066b7a51f7e1d263a1db66235 (diff)
downloadpandoc-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.hs4
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"