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

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -