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
Most of the time the default jackson behavior is fine, but if your json is embedded in an html page, in a script tag and it contains an HTML tag (like script, </script> unescaped, it will be parsed as the closing tag of the script container before the real one), this can cause some headaches.
A possible solution would be to enable this feature by default, matching json-str behavior.
What do you think about this?
The text was updated successfully, but these errors were encountered:
Okay, I've release 2.1.0 which has hooks to allow setting any of the custom Jackson options.
However, I don't think the ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER behaves like you would like it to, it allows for a different set of escaped characters to be passed in, not auto-escaping things.
As a workaround for your case, I would recommend a replaceAll on the string:
I did something quite similar to your example in the end, it is necessary only in some rare exceptions so I wasn t so sure about making this a default anymore.
Hello,
clojure.contrib.json escapes backslashes by default, even though it is not a standard feature Jackson supports this as well through http://jackson.codehaus.org/1.9.0/javadoc/org/codehaus/jackson/JsonParser.Feature.html#ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER
Here is an example that illustrates the issue:
Most of the time the default jackson behavior is fine, but if your json is embedded in an html page, in a script tag and it contains an HTML tag (like script, </script> unescaped, it will be parsed as the closing tag of the script container before the real one), this can cause some headaches.
A possible solution would be to enable this feature by default, matching json-str behavior.
What do you think about this?
The text was updated successfully, but these errors were encountered: