mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-22 04:45:12 +00:00
Update jquery.autocomplete.js
This commit is contained in:
parent
2952f328cd
commit
864541e245
8
dist/jquery.autocomplete.js
vendored
8
dist/jquery.autocomplete.js
vendored
@ -127,9 +127,15 @@
|
||||
$.Autocomplete = Autocomplete;
|
||||
|
||||
Autocomplete.formatResult = function (suggestion, currentValue) {
|
||||
var htmlSafeString = suggestion.value
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"');
|
||||
|
||||
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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user