2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-09 14:50:57 +00:00

Update jquery.autocomplete.js

This commit is contained in:
André Fiedler 2015-03-24 10:14:39 +01:00
parent 2952f328cd
commit 864541e245

View File

@ -127,9 +127,15 @@
$.Autocomplete = Autocomplete;
Autocomplete.formatResult = function (suggestion, currentValue) {
var htmlSafeString = suggestion.value
.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;');
var pattern = '(' + utils.escapeRegExChars(currentValue) + ')';
return suggestion.value.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
return htmlSafeString.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
};
Autocomplete.prototype = {