I'm using jeditable and having some encoding issues. If I enter &
, save, and then try to edit it shows up as &
.
Easily reproducible here: http://www.appelsiini.net/projects/jeditable/default.html
Edit the Normal textarea and enter &&&
, save and then edit again and you'll see it. How can I fix this?
A way better solution.... even for compressed js file.
Search for line :
self.revert = $(self).html();
replace with
self.revert = $(self).text();
Solution no1 would not work if you would like to have "&" in your editable field Sollution no2 is version dependent
solution:
input_content = $('<textarea/>').html(self.revert).val();
This converts the input to a html_safe type format. This goes in around line 247 to replace:
input_content = self.revert;
I encountered the same issue, here is what I edited in the jquery.jeditable.js
(v 1.7.1) file :
replace l.176 :
self.editing = true;
self.revert = $(self).html();
$(self).html('');
by
self.editing = true;
self.revert = $(self).html().replace(/&/g,"&");
$(self).html('');
This is a simple regexp replacing &
by &
and it did the job !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With