vitalets / x-editable

In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
http://vitalets.github.io/x-editable
MIT License
6.51k stars 1.73k forks source link

Render html in checklists, instead of showing it as text #1168

Open nickpapoutsis opened 3 years ago

nickpapoutsis commented 3 years ago

I have tried displaying images in a checklist (<img src="/image/hd.jpg">) but it was getting escaped and wouldn't load.

I used escape: false but it didn't make a difference. Maybe it's my weird mix of x-editable inside DataTables but nothing I did was working until I modified the x-editable source code.

Example using https://cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.1/bootstrap3-editable/js/bootstrap-editable.js

Find .append($('<span>').text(' '+this.sourceData[i].text)); on line 3267 and change it to .append($('<span>').html(' '+this.sourceData[i].text));.

Spent way too many hours before looking into the actual source code :(

Thanks to @HunterJoe for pointing me in the right direction (here: https://github.com/vitalets/x-editable/issues/594).