Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed #9883: no longer do strange things with whitespace in t…

…he linebreaks filter. Thanks, keithb.

Backport of r10225 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10292 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 09953968172935ac5665cf75f0de87961d1741fe 1 parent 7475092
Jacob Kaplan-Moss authored March 31, 2009

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/utils/html.py
4  django/utils/html.py
@@ -46,9 +46,9 @@ def linebreaks(value, autoescape=False):
46 46
     value = re.sub(r'\r\n|\r|\n', '\n', force_unicode(value)) # normalize newlines
47 47
     paras = re.split('\n{2,}', value)
48 48
     if autoescape:
49  
-        paras = [u'<p>%s</p>' % escape(p.strip()).replace('\n', '<br />') for p in paras]
  49
+        paras = [u'<p>%s</p>' % escape(p).replace('\n', '<br />') for p in paras]
50 50
     else:
51  
-        paras = [u'<p>%s</p>' % p.strip().replace('\n', '<br />') for p in paras]
  51
+        paras = [u'<p>%s</p>' % p.replace('\n', '<br />') for p in paras]
52 52
     return u'\n\n'.join(paras)
53 53
 linebreaks = allow_lazy(linebreaks, unicode)
54 54
 

0 notes on commit 0995396

Please sign in to comment.
Something went wrong with that request. Please try again.