I tried to show a json widget. But it was broken. Then I discovered that it was one of the fields inside my json that had the content </script>. Something like:
{"html": "<p>A paragraph</p><script>const a = 10;</script>"}
The issue is this: The </script> makes the script used by django-json-widget end immediately there. So the reminder of the json is rendered into the browser and the json widget throws an error in the JavaScript developer console.
Description
I tried to show a json widget. But it was broken. Then I discovered that it was one of the fields inside my json that had the content
</script>
. Something like:{"html": "<p>A paragraph</p><script>const a = 10;</script>"}
The issue is this: The
</script>
makes the script used by django-json-widget end immediately there. So the reminder of the json is rendered into the browser and the json widget throws an error in the JavaScript developer console.