We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2952f32 commit 864541eCopy full SHA for 864541e
dist/jquery.autocomplete.js
@@ -127,9 +127,15 @@
127
$.Autocomplete = Autocomplete;
128
129
Autocomplete.formatResult = function (suggestion, currentValue) {
130
+ var htmlSafeString = suggestion.value
131
+ .replace(/&/g, '&')
132
+ .replace(/</g, '<')
133
+ .replace(/>/g, '>')
134
+ .replace(/"/g, '"');
135
+
136
var pattern = '(' + utils.escapeRegExChars(currentValue) + ')';
137
- return suggestion.value.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
138
+ return htmlSafeString.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
139
};
140
141
Autocomplete.prototype = {
0 commit comments