From 810b613bc2be86d04e3955a17d9bc839fe386451 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 20 Dec 2016 10:50:59 +0000 Subject: [PATCH] Remove nl2br Jinja filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was used when the code for previewing SMS templates lived in the admin. ⌘F seems to suggest it’s not used anywhere else. --- app/__init__.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 416b8835c..6bd4c4b02 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -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'

%s

' % p.replace('\n', Markup('
\n')) - for p in _paragraph_re.split(escape(value))) - return Markup(result) - - def linkable_name(value): return urllib.parse.quote_plus(value)