mirror of
https://github.com/django/django.git
synced 2025-09-22 02:02:46 +00:00
Fixed #10931 -- Made Truncator
handle newlines properly. Thanks to gsong and Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17329 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6fa62b8166
commit
1572a3d4b2
2 changed files with 7 additions and 2 deletions
|
@ -18,8 +18,8 @@ capfirst = lambda x: x and force_unicode(x)[0].upper() + force_unicode(x)[1:]
|
|||
capfirst = allow_lazy(capfirst, unicode)
|
||||
|
||||
# Set up regular expressions
|
||||
re_words = re.compile(r'&.*?;|<.*?>|(\w[\w-]*)', re.U)
|
||||
re_tag = re.compile(r'<(/)?([^ ]+?)(?: (/)| .*?)?>')
|
||||
re_words = re.compile(r'&.*?;|<.*?>|(\w[\w-]*)', re.U|re.S)
|
||||
re_tag = re.compile(r'<(/)?([^ ]+?)(?: (/)| .*?)?>', re.S)
|
||||
|
||||
|
||||
def wrap(text, width):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue