Created
March 5, 2010 23:30
-
-
Save wyattdanger/323292 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from re import sub | |
from django import template | |
register = template.Library() | |
@register.filter(name='cleanhtml') | |
def cleanhtml(value): | |
'''Removes inline styles from WYSIWYG-generated markup.''' | |
return sub('(\s?style\s?=\s?[\'\"].+[\'\"])', '', str(value)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment