Login

Django filter stack to cleanup WYSIWYG output

Author:
jbergantine
Posted:
August 31, 2011
Language:
HTML/template
Version:
1.3
Tags:
template filter wysiwyg
Score:
1 (after 1 ratings)

Django Template Tag Filter stack to clean up output from widgEditor or other WYSIWYG text-input box. Removes arbitrary line break code and replaces with Django's cleaner |linebreaks filter. Also removes any arbitrary styling, leaving in things like bold, italic, link and image tags.

1
{{ value|removetags:"br div p span style"|safe|linebreaks }}

More like this

Comments

Please login first before commenting.