2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2025-01-03 14:47:25 +00:00

Update jquery.autocomplete.js

This commit is contained in:
André Fiedler 2015-03-24 10:14:06 +01:00
parent 82abff9f3c
commit 2952f328cd

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 = {