-
Notifications
You must be signed in to change notification settings - Fork 215
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
Response needs to be HTML escaped #123
Comments
Had to do this recently, haven't had this problem in the past... |
Thank you for raising this, spent a good few hours trying to work out this one. Particularly frustrating since remotipart also swallows ajax requests in the console. Agree that it should be documented. |
Thanks for sharing the solution @mdesantis , I was having the same issue here. |
You're welcome, happy to help |
There seems to be a difference from version 1.0 to 1.2 where the old code set the text like so:
Whereas the new code does it like this:
So it's using root.textContent or root.innerText. I suspect root.textContent escapes any |
Thanks @mdesantis as well. Your workaround made my day! |
Thanks @mdesantis, This works if I have remotipart data, but currently, we have a scenario where we use the same form for different cases. If remotipart is not being used in that, then this fails because the response is HTML escaped. |
As I wrote in the issue #122, I have some response errors (no response execution, syntax errors, ...) due to the fact that the response contains a
render partial: ...
, and remotipart wraps response into a<textarea data-type="text/javascript">...</textarea>
, so its content should be HTML escaped. I resolved turning the create.js.erb view from this:into this:
I don't know whether this behaviour is expected or not, but I think it should at least documented in the Readme, since it leads to unexepcted errors.
The text was updated successfully, but these errors were encountered: