I have a Django context variable which is a jsonified list of strings but some of those strings might have a single quote '
import json
list_of_strings = ["test", "hello", "I have a'single quote"]
return render(request, 'template.html', {
'strings': json.dumps(list_of_strings)
})
Then I insert it into a vue component through one of his props which, as you can see, must be wrapped between single quotes.
:strings='{{ strings|safe }}'
But it crashes, just insert the list until the first single quote and then writes everything else as text in the browser.
How can I escape it?