Escaping JSON string in Sightly -
i have following sightly template:
<body> <script type="application/json" id="test"> [ { "url": "${test}" } ] </script> </body> i want escape value of 'test' using json style escaping. unfortunately, using context='scriptstring' escapes dash '\-', invalid json.
how can use json style escaping on value?
you need use context='unsafe' write json this:
${test @ context='unsafe'}
Comments
Post a Comment