Open Jimmerz28 opened 7 years ago
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.
?js_string
?json_string
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.
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:
Generates:
Which is invalid JSON.
If this project is still maintained let me know and I can create a PR.