mirror of
https://github.com/django/django.git
synced 2025-09-22 02:02:46 +00:00
Fixed #12119. Changed smart_split to stop splitting on whitespace in quotes. Thanks, emulbreh.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12581 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
3304afa67a
commit
c8cd8b80aa
2 changed files with 10 additions and 3 deletions
|
@ -202,9 +202,14 @@ javascript_quote = allow_lazy(javascript_quote, unicode)
|
|||
# Expression to match some_token and some_token="with spaces" (and similarly
|
||||
# for single-quoted strings).
|
||||
smart_split_re = re.compile(r"""
|
||||
([^\s"]*"(?:[^"\\]*(?:\\.[^"\\]*)*)"\S*|
|
||||
[^\s']*'(?:[^'\\]*(?:\\.[^'\\]*)*)'\S*|
|
||||
\S+)""", re.VERBOSE)
|
||||
((?:
|
||||
[^\s'"]*
|
||||
(?:
|
||||
(?:"(?:[^"\\]|\\.)*" | '(?:[^'\\]|\\.)*')
|
||||
[^\s'"]*
|
||||
)+
|
||||
) | \S+)
|
||||
""", re.VERBOSE)
|
||||
|
||||
def smart_split(text):
|
||||
r"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue