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

  1. Smart Spaceless by btaylordesign 4 years, 1 month ago
  2. Analogue template filter to removetags that also removes the content of the tag by piquadrat 4 years, 6 months ago
  3. Template tag: Group variables into list by Killarny 6 years, 2 months ago
  4. Add CSS class template filter by lazerscience 4 years, 6 months ago
  5. Template filter for internal links in TextFields by bobtiki 6 months, 2 weeks ago

Comments

Please login first before commenting.