From c8ad87c2dcae02dee537dd51b4661c6411163453 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Mon, 30 Mar 2009 22:39:13 +0000 Subject: [PATCH] Fixed #9883: no longer do strange things with whitespace in the linebreaks filter. Thanks, keithb. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10225 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/utils/html.py b/django/utils/html.py index 9b3fad8b03..c985538041 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -46,9 +46,9 @@ def linebreaks(value, autoescape=False): value = re.sub(r'\r\n|\r|\n', '\n', force_unicode(value)) # normalize newlines paras = re.split('\n{2,}', value) if autoescape: - paras = [u'

%s

' % escape(p.strip()).replace('\n', '
') for p in paras] + paras = [u'

%s

' % escape(p).replace('\n', '
') for p in paras] else: - paras = [u'

%s

' % p.strip().replace('\n', '
') for p in paras] + paras = [u'

%s

' % p.replace('\n', '
') for p in paras] return u'\n\n'.join(paras) linebreaks = allow_lazy(linebreaks, unicode)