Ticket #9883: no_strip.diff

File no_strip.diff, 767 bytes (added by keithb, 6 years ago)
  • django/utils/html.py

     
    4646    value = re.sub(r'\r\n|\r|\n', '\n', force_unicode(value)) # normalize newlines
    4747    paras = re.split('\n{2,}', value)
    4848    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]
    5050    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]
    5252    return u'\n\n'.join(paras)
    5353linebreaks = allow_lazy(linebreaks, unicode)
    5454
Back to Top