Source code for intranet.apps.templatetags.newtab_links
import re
from django import template
register = template.Library()
[docs]@register.filter(is_safe=True)
def replace_newtab_links(value):
return re.sub(r'<a(.*?href ?= ?[\'"]http.*?)>', r'<a target="_blank"\1>', value)