Remove nl2br Jinja filter

This was used when the code for previewing SMS templates lived in the
admin. ⌘F seems to suggest it’s not used anywhere else.
This commit is contained in:
Chris Hill-Scott
2016-12-20 10:50:59 +00:00
parent 5411fc4c7f
commit 810b613bc2

View File

@@ -111,7 +111,6 @@ def create_app():
application.session_interface = ItsdangerousSessionInterface()
application.add_template_filter(nl2br)
application.add_template_filter(format_datetime)
application.add_template_filter(format_datetime_24h)
application.add_template_filter(format_datetime_normal)
@@ -190,14 +189,6 @@ def convert_to_boolean(value):
return value
def nl2br(value):
_paragraph_re = re.compile(r'(?:\r\n|\r|\n){2,}')
result = u'\n\n'.join(u'<p>%s</p>' % p.replace('\n', Markup('<br>\n'))
for p in _paragraph_re.split(escape(value)))
return Markup(result)
def linkable_name(value):
return urllib.parse.quote_plus(value)