Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

escape_javascript ignores \u2028 #2587

Closed
keymone opened this Issue · 4 comments

3 participants

@keymone

this unicode character: \u2028 ( http://www.fileformat.info/info/unicode/char/2028/index.htm ) 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

@siong1987

Commit has been made with issue #2618.

@siong1987

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

@keymone keymone closed this
@keymone

thanks

@hems

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.