From deb72b5f43949fabaa7d20137259572042997fbf Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 29 Apr 2012 14:20:19 -0700 Subject: 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. --- src/Text/Pandoc/Writers/ConTeXt.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text') 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" -- cgit v1.2.3