Skip to content
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

Apostrophe Incorrectly Escaped #3

Open
Jimmerz28 opened this issue Oct 20, 2017 · 0 comments
Open

Apostrophe Incorrectly Escaped #3

Jimmerz28 opened this issue Oct 20, 2017 · 0 comments

Comments

@Jimmerz28
Copy link

Currently, it looks like any strings apostrophes are getting escaped with a backslash as they are being escaped with ?js_string instead of ?json_string which is leading to invalid JSON being generated.

http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_json_string

For example:

[#assign something = { brain: "Some strings' string" } ]

<script type="application/json" id="subnavigationProps">
    [@json.stringify something /]
</script>

Generates:

<script type="application/json">
    {"brain":"Some string\'s string"}
</script>

Which is invalid JSON.

If this project is still maintained let me know and I can create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant