mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-09 14:50:57 +00:00
Merge pull request #336 from SunboX/fix-html-entities
Fix html entities
This commit is contained in:
commit
08c284c00d
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 = {
|
||||
|
@ -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