-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escaping of forward slash in JSON output method #530
Comments
This was addressed by PR #534 which was accepted. |
Typo noted (3 times):
Also: we should add the |
@michaelhkay This issue can probably be closed… Unless we decide to rename |
The issue remains open, to correct the typo whereby the |
PR #942 has been raised to fix the remaining typo. |
The fact that we escape forward slash in the JSON output method has proved unpopular with quite a few users.
The rationale for doing it is discussed at https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped
The short summary is that it's only needed when JSON is inserted into an HTML
script
element, and then only when immediately followed by>
.There's a workaround using character maps but it's really clumsy.
I don't want to escape forward slashes by default in the xdm-to-json() function because they appear so often in namespaces and it adds an awful lot of visual clutter. That means that our JSON formatter needs an option to suppress this escaping, which means we might as well provide user control over it as an output property...
Adding a new output property just for this purpose is rather heavyweight both in the specs and in our implementation, but I can't think of a better solution. So I propose adding
escape-solidus
, values yes/no, default (for compatibility) yes.Yes, someone will ask about the name. Surely no-one calls it a solidus? Well, Unicode does, and I think we should use the official name. And it avoids arguing about whether it should be slash or forwards-slash or forward-slash. At least I'm not proposing virgule.
The text was updated successfully, but these errors were encountered: