jmrivas86 / django-json-widget

An alternative widget that makes it easy to edit the new Django's field JSONField (PostgreSQL specific model fields)
MIT License
433 stars 88 forks source link

</script> is a problem #80

Open johanneswilm opened 10 months ago

johanneswilm commented 10 months ago

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.