Re: HTML text editing

2009-12-13 Thread Riku
Thanks. I've solved the problem now. I first just added the {% autoescape off %} and {% endautoescape %} tags around a block in my 'base.html' template. I understand that this isn't safe, so I'll have to get find some solution for this. I'll test Brian's solution below. Thanks again for your comm

Re: HTML text editing

2009-12-11 Thread Brian McKeever
I wrote a html whitelist filter that only allows predefined tags, and runs however many filters you want to specify on it. I'd be curious what you guys thought about it. http://sourceforge.net/projects/htmlfilterfacto/ On Dec 11, 2:51 pm, Shawn Milochik wrote: > Look at safestring. > > from dja

Re: HTML text editing

2009-12-11 Thread Shawn Milochik
Look at safestring. from django.utils import safestring The docs will explain all, but basically you do this: the_html = safestring.mark_safe(your_html) The text in "the_html," if passed in your template, will not be escaped. The standard warning should be repeated here -- be sure you trust yo

HTML text editing

2009-12-11 Thread Riku
Hi, I just got a wysiwyg editor to work in my forms, but then I noticed that HTML is autoescaped, so I can't really use it. What should I use in order to allow users to use a wysiwyg editor to input text and then show it with the same formatting on the webpage? By default all the entered text is