Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript escaping not compatible with Rails #14

Open
joe1chen opened this issue Jun 4, 2013 · 0 comments
Open

Javascript escaping not compatible with Rails #14

joe1chen opened this issue Jun 4, 2013 · 0 comments

Comments

@joe1chen
Copy link

joe1chen commented Jun 4, 2013

Hi,
I'm looking into a bug (brianmario/escape_utils#43) with the escape_utils gem, which relies on houdini.

The problem is that escape_utils relies on houdini's escape javascript function, which currently doesn't seem to be compatible with the typical Rails use-case.

The Rail's escape_javascript function currently escapes carriage returns and single and double quotes for JavaScript segments. The typical use case is something like this:

$('some_element').replaceWith('<%=escape_javascript render 'some/element_template' %>');

The HTML output of the render call is escaped so that it is valid as a Javascript string.

Is it possible to change the current houdini javascript escape function to behave similarly? Or add options so that a Rails-compatible javascript escape is exposed? This would fix the bug in escape_utils.

Or if not, can you explain what the typical use case is for the existing escape javascript function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant