Loading django/utils/text.py +8 −3 Original line number Diff line number Diff line Loading @@ -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 tests/regressiontests/text/tests.py +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ friends' [u'url', u'search_page', u'words=hello'] >>> list(smart_split(u'url search_page words="something else')) [u'url', u'search_page', u'words="something', u'else'] >>> list(smart_split("cut:','|cut:' '")) [u"cut:','|cut:' '"] ### urlquote ############################################################# >>> from django.utils.http import urlquote, urlquote_plus Loading Loading
django/utils/text.py +8 −3 Original line number Diff line number Diff line Loading @@ -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
tests/regressiontests/text/tests.py +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ friends' [u'url', u'search_page', u'words=hello'] >>> list(smart_split(u'url search_page words="something else')) [u'url', u'search_page', u'words="something', u'else'] >>> list(smart_split("cut:','|cut:' '")) [u"cut:','|cut:' '"] ### urlquote ############################################################# >>> from django.utils.http import urlquote, urlquote_plus Loading