Kaz Kylheku <046…@kylheku.com> writes:
> On 2026-11-16, Anton Antimo <ant…@safunu.org> wrote:
>> It seems cl-json is automatically escaping slashes when I invoke
>> encode-json-to-string. I located the question
>>
>> https://stackoverflow.com/questions/60103909
>>
>> that explains that the JSON spec mandates the escaping of slashes, but
>> doesn't really explain why, although it says there's not quite a
>> practical need for that.
>>
>> Do you know why the escaping of slashes was considered in the first place?
>
> It allows JSON to be embedded into HTML.
>
> Consider JSON which looks like this:
>
> [ "</script>" ] // oops: false positive for end of script marker.
>
> [ "<\/script>" ] // no problem
Interesting. So the JSON spec was particularly thinking of HTML at its
beginning? I never thought of JSON as too intimate of HTML, but perhaps
it was meant for the web specifically. Thanks for the info.