Side navigation
Ticket #2018: jquery.autocomplete.js.diff
File jquery.autocomplete.js.diff, 0.6 KB (added by ash, December 06, 2007 02:06PM UTC)
Trivial patch
Index: jquery.autocomplete.js
===================================================================
--- jquery.autocomplete.js (revision 959)
+++ jquery.autocomplete.js (revision 960)
@@ -507,7 +507,7 @@
multiple: false,
multipleSeparator: ", ",
highlight: function(value, term) {
- return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
+ return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(new RegExp("([()[\\]\\\\{}?.+*|^$])","gi"),"\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
},
scroll: true,
scrollHeight: 180,
Download in other formats:
Original Format
File jquery.autocomplete.js.diff, 0.6 KB (added by ash, December 06, 2007 02:06PM UTC)
Trivial patch
Index: jquery.autocomplete.js
===================================================================
--- jquery.autocomplete.js (revision 959)
+++ jquery.autocomplete.js (revision 960)
@@ -507,7 +507,7 @@
multiple: false,
multipleSeparator: ", ",
highlight: function(value, term) {
- return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
+ return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(new RegExp("([()[\\]\\\\{}?.+*|^$])","gi"),"\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
},
scroll: true,
scrollHeight: 180,