id summary reporter owner description type status priority milestone component version severity resolution keywords cc branch changelog apichanges internalchanges 11358 add_script_data with U+2028/U+2029 characters lead a SyntaxError on Python 2.4/2.5 Jun Omae Jun Omae "In ECMA script, U+000a, U+000d, U+2028 and U+2029 characters are considers to be line terminators. `json` library is Therefore, we should escape those characters while passing to `add_script_data`, `to_json`, `javascript_quote` and `to_js_string`. If Python 2.6+ which json library is available, the issue doesn't happen. Adding the following {{{ add_script_data(req, {'test': u'\u2029'}) }}} ... leads the following error in browser. {{{ Uncaught SyntaxError: Unexpected token ILLEGAL }}} See http://bclary.com/2004/11/07/#a-7.3" defect closed normal 0.12.6 general 0.12-stable normal fixed Fix `to_json`, `to_js_string` and `javascript_quote` to escape line terminators U+2028 and U+2029 characters to avoid a `SyntaxError` in javascript