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)