Added new template filter 'textify' which changes </b> and </i> tags to '*' and '/' instead
- Legacy-Id: 4638
This commit is contained in:
parent
aa65e63dff
commit
af2392084a
|
@ -466,6 +466,13 @@ def user_roles_json(user):
|
||||||
roles[g.name] = True
|
roles[g.name] = True
|
||||||
return mark_safe(simplejson.dumps(roles))
|
return mark_safe(simplejson.dumps(roles))
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def textify(text):
|
||||||
|
text = re.sub("</?b>", "*", text)
|
||||||
|
text = re.sub("</?i>", "/", text)
|
||||||
|
# There are probably additional conversions we should apply here
|
||||||
|
return text
|
||||||
|
|
||||||
def _test():
|
def _test():
|
||||||
import doctest
|
import doctest
|
||||||
doctest.testmod()
|
doctest.testmod()
|
||||||
|
|
Loading…
Reference in a new issue