]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Use $.ui.autocomplete.escapeRegex in combobox demo; Fixes #5436 Autocom...
authorjzaefferer <joern.zaefferer@gmail.com>
Fri, 26 Mar 2010 14:59:34 +0000 (10:59 -0400)
committerjzaefferer <joern.zaefferer@gmail.com>
Fri, 26 Mar 2010 14:59:34 +0000 (10:59 -0400)
demos/autocomplete/combobox.html

index e5dc6c92b1e6c84c6d23a05a51015c871701e464..4c6b656a195679103670e55d5d338ae3c05ba011 100644 (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
                                                                        };
                                                        }));