Hello,
I have a search criteria with an ampersand:
house & home
When i do an edit back space, I can edit the criteria again, but select2 converts the string to:
house & home
ie it changes the & to &
If I modify the below code to escape item.text it works correctly.
Search.prototype.searchRemoveChoice = function (decorated, item) { this.trigger('unselect', { data: item }); // this.$search.val(item.text); this.$search.val($.parseHTML(item.text)[0].textContent); this.handleSearch(); };
What would be the correct way to do this?
Cheers
I need to use escapeMarkup as by criteria has html, <b>house</b> & home
$("#searchStringId").select2({ multiple: true, escapeMarkup: function (markup) { return markup; }, minimumInputLength: 2, templateResult: formatRepo, templateSelection: formatRepoSelection, ajax: {...}, });