Closed abrudz closed 4 years ago
Thanks for the suggestion. The reason that JSON incluldes \/
as a special escape is because JSON's list of escapes is exclusive while ES5's list is not. For example, \a
is an error in JSON, but \a
is just a
in ES5.
The reason for JSON to include \/
in its list is, I've seen cited but don't have a source, as a way to allow </script>
to appear in HTML source code as <\/script>
so the browser doesn't assume it's the end of the script block.
Since JSON5 follows ES5 escape rules, the explicit listing for \/
isn't needed, so it's left out just like in the ES5 spec.
Ah, I see. Sorry to disturb, then.
No need to apologize. I appreciate all contributions to this project. Thanks for noticing the discrepancy and bringing it here.
The [list of escapes]() is missing one entry:
\/
This one (while not needed) is part of the JSON spec: