You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, removing the "$" from the last key/value pair produces the expected result.
Have I overlooked something in the JSON.parse() syntax?
Short of replace(ing)() the "$" with something like "AUD" character in pre-processing, is there some other workaround?
Thank you.
The text was updated successfully, but these errors were encountered:
Writing a $ in a string literal is Julia syntax for interpolating something into the string (see https://docs.julialang.org/en/v1/manual/strings/#string-interpolation). You can see that you get the error, even if you remove the JSON.parse part. The solution is to either escape the $ (via \$) or use a raw string (via raw"""... $3.00...""").
Greetings.
When trying to parse <script type = text/javascript>...</script> that contains the $ character JSON.parse() produces the following output:
JSON.parse("""{
"this": ["is", "json"],
"numbers": [85, 16, 12.0],
"and": [true, false, null],
"but not": ["1", 2,"$3.00"]}""")
ERROR: syntax: invalid interpolation syntax: "$3"
Stacktrace:
[1] top-level scope at none:1
However, removing the "$" from the last key/value pair produces the expected result.
Have I overlooked something in the JSON.parse() syntax?
Short of replace(ing)() the "$" with something like "AUD" character in pre-processing, is there some other workaround?
Thank you.
The text was updated successfully, but these errors were encountered: