I’ve added the Dojo wysiwyg editor to my django admin panel. I have an issue when I type more than one space. When I output the syntax created by the editor to a template I get   for each extra space. I assume it’s trying to create a non-breaking space, but it renders in the browser as .
Does anyone know why this is? How would I go about fixing this?
After a little research you want to use the template filter safe to fix this issue. You’ll probably also want to add the filter removetags with script as an option to remove potentially malicious javascript. So my template variable ends up looking like this:
{{ var|removetags:"script"|safe }}