diff options
author | majorseitan@blockfreie.org <majorseitan@blockfreie.org> | 2018-05-26 12:46:56 -0400 |
---|---|---|
committer | majorseitan@blockfreie.org <majorseitan@blockfreie.org> | 2018-05-26 12:46:56 -0400 |
commit | f993a516913883eda783bbe7cae80dfd42e2b428 (patch) | |
tree | 1a09a20b5a422f6d1fee490d75d49cdece1b1168 /lib/ur | |
parent | e2552a79ed87721a81c246b9cfd053701d665f25 (diff) |
Handling of JSON escape characters
1. Handle the escape character
\/
Diffstat (limited to 'lib/ur')
-rw-r--r-- | lib/ur/json.ur | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ur/json.ur b/lib/ur/json.ur index 7ebb010f..817ec16e 100644 --- a/lib/ur/json.ur +++ b/lib/ur/json.ur @@ -53,6 +53,7 @@ fun escape s = | #"\"" => "\\\"" | #"\'" => "\\\'" | #"\\" => "\\\\" + | #"/" => "\\/" | x => String.str ch ) ^ esc (String.suffix s 1) end @@ -102,6 +103,7 @@ fun unescape s = | #"\"" => "\"" | #"\'" => "\'" | #"\\" => "\\" + | #"/" => "/" | x => error <xml>JSON unescape: Bad escape char: {[x]}</xml>) ^ unesc (i+2) |