It seems that json.encode() only translates Lua strings passed with double quotes and not single quotes:

json.encode({"read('any')"})
-> [ "read('any')" ]
json.encode({'read("any")'})
-> []

Is there a reason for this behavior?
How can I obtain a JSON array containing the JSON string read("any") ?
I also tried:

json.encode({"read(\x22any\x22)"})
"[]"

but no way...

It's a bug, I have fixed it.
Thank you for this report steve !

Powered by: FreeFlarum.
(remove this footer)