Ticket #9883: no_strip.diff
File no_strip.diff, 767 bytes (added by , 16 years ago) |
---|
-
django/utils/html.py
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