Skip to content

Passing JSON to <script> Tag #323

Closed Answered by michael-mader
michael-mader asked this question in Q&A
Discussion options

You must be logged in to vote

I've found another way. JTE cannot know what I am trying to achieve 😄
I created a small helper function which sanitizes the JSON string (escaping all </script> in the string) which returns gg.jte.Content with the sanitized string. This way I don't need to use $unsafe and the output is properly sanitized.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by michael-mader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant