Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


escape_javascript ignores \u2028 #2587

keymone opened this Issue · 4 comments

3 participants


this unicode character: \u2028 ( ) is ignored by escape_javascript method but it is not ignored by javascript parsers(interpreted as actual line break, just like \n) which causes parsing errors

one-line patch to fix it:

  result.sub!("\342\200\250", "

in actionpack/lib/action_view/helpers/javascript_helper.rb on line 22


Commit has been made with issue #2618.


This issue should be closed since it has been fixed by #2618.

@keymone keymone closed this



sorry to make this zombie alive, am using ruby 1.9.3p194 and that char still breaks my javascript even after the "escape_javascript" call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.