Autocomplete: Use $.ui.autocomplete.escapeRegex in combobox demo; Fixes #5436 Autocomplete: use $.ui.autocomplete.escapeRegex in combox demo

This commit is contained in:
jzaefferer 2010-03-26 10:59:34 -04:00
parent b297b3fa6a
commit 56a3d4cbff

View File

@ -33,7 +33,7 @@
if (!request.term || matcher.test(text))
return {
id: $(this).val(),
label: text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + request.term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"),
label: text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"),
value: text
};
}));