From cd06a273903da37ebd1e5c71e7b41f32cf2ef52c Mon Sep 17 00:00:00 2001 From: Julian Rohrhuber Date: Mon, 23 Jan 2023 18:07:18 +0100 Subject: [PATCH 1/2] show how to escape escaping --- HelpSource/Classes/JSONlib.schelp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/HelpSource/Classes/JSONlib.schelp b/HelpSource/Classes/JSONlib.schelp index 77706d0..df4cc87 100644 --- a/HelpSource/Classes/JSONlib.schelp +++ b/HelpSource/Classes/JSONlib.schelp @@ -26,7 +26,12 @@ code:: // escaping of quotes is necessary j = "{\"hello\": 42}"; JSONlib.convertToSC(j); -// -> -> ( 'hello': 42 ) +// -> ( 'hello': 42 ) + +// to avoid the need for escaping strings, you can also use a symbol: +j = '{"hello": 42}'; +JSONlib.convertToSC(j); +// -> ( 'hello': 42 ) :: Also see link::#*new:: and the link::#examples::. From d5671ed4ebd988bd175bf0cb4562b04932dd0ef7 Mon Sep 17 00:00:00 2001 From: Julian Rohrhuber Date: Mon, 23 Jan 2023 18:22:43 +0100 Subject: [PATCH 2/2] unescape escapes --- HelpSource/Classes/JSONlib.schelp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HelpSource/Classes/JSONlib.schelp b/HelpSource/Classes/JSONlib.schelp index df4cc87..e8670e3 100644 --- a/HelpSource/Classes/JSONlib.schelp +++ b/HelpSource/Classes/JSONlib.schelp @@ -28,7 +28,8 @@ j = "{\"hello\": 42}"; JSONlib.convertToSC(j); // -> ( 'hello': 42 ) -// to avoid the need for escaping strings, you can also use a symbol: +// to avoid the need for escaping strings, you can also use a symbol. +// (note that you still need to escape ' if they are in your json) j = '{"hello": 42}'; JSONlib.convertToSC(j); // -> ( 'hello': 42 )