diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-12 04:57:50 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-12 04:57:50 +0000 |
| commit | f0c9bc5563d8a4df657ed71229dd6ffe49dfaf94 (patch) | |
| tree | 1cd5a3c8457fd19df7f04c3a605c1db70dccf110 /django/template | |
| parent | a83e4cb1959edc1d5dc5ebe4e1065bbe254062a7 (diff) | |
[1.0.X] Fixed #10675 -- Added unicode paragraph and line-sep handling to escapejs.
There were a couple of line breaking Unicode characters (\u2028 and
\u2029) that cause Javascript errors, at least in Firefox, if not
escaped. So now we do so. Based on a patch from rleland.
Backport of r10543 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10544 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/template')
| -rw-r--r-- | django/template/defaultfilters.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index 01961a338f..f8fd2e76eb 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -76,7 +76,9 @@ _base_js_escapes = ( ('&', r'\x26'), ('=', r'\x3D'), ('-', r'\x2D'), - (';', r'\x3B') + (';', r'\x3B'), + (u'\u2028', r'\u2028'), + (u'\u2029', r'\u2029') ) # Escape every ASCII character with a value less than 32. |
