git.iko.soy/typeable/pandoc
on master help sign in
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.

commitdeb72b5f43949fabaa7d20137259572042997fbf authorJohn MacFarlane <fiddlosopher@gmail.com> dateSun 29 Apr 2012, 14:20 (14 years ago) parenta9f037a
1 file changed+2−2
src/Text/Pandoc/Writers/ConTeXt.hs+2−2
src/Text/Pandoc/Writers/ConTeXt.hs+2−2
@@ -95,7 +95,7 @@ escapeCharForConTeXt ch =
9595 '$' -> "\\$"
9696 '|' -> "\\letterbar{}"
9797 '^' -> "\\letterhat{}"
98− '%' -> "\\%"
98+ '%' -> "\\letterpercent "
9999 '~' -> "\\lettertilde{}"
100100 '&' -> "\\&"
101101 '#' -> "\\#"
@@ -298,7 +298,7 @@ inlineToConTeXt (Link txt (src, _)) = do
298298 label <- inlineListToConTeXt txt
299299 return $ "\\useURL"
300300 <> brackets (text ref)
301− <> brackets (text $ escapeStringUsing [('#',"\\#")] src)
301+ <> brackets (text $ escapeStringUsing [('#',"\\#"),('%',"\\%")] src)
302302 <> brackets empty
303303 <> brackets label
304304 <> "\\from"