File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 127127 $ . Autocomplete = Autocomplete ;
128128
129129 Autocomplete . formatResult = function ( suggestion , currentValue ) {
130- var pattern = '(' + utils . escapeRegExChars ( currentValue ) + ')' ;
131-
132- return suggestion . value
133- . replace ( new RegExp ( pattern , 'gi' ) , '<strong>$1<\/strong>' )
134- . replace ( / & / g, '&' )
135- . replace ( / < / g, '<' )
136- . replace ( / > / g, '>' )
137- . replace ( / " / g, '"' )
138- . replace ( / & l t ; ( \/ ? s t r o n g ) & g t ; / g, '<$1>' ) ;
130+ if ( currentValue ) {
131+ var pattern = '(' + utils . escapeRegExChars ( currentValue ) + ')' ;
132+
133+ return suggestion . value
134+ . replace ( new RegExp ( pattern , 'gi' ) , '<strong>$1<\/strong>' )
135+ . replace ( / & / g, '&' )
136+ . replace ( / < / g, '<' )
137+ . replace ( / > / g, '>' )
138+ . replace ( / " / g, '"' )
139+ . replace ( / & l t ; ( \/ ? s t r o n g ) & g t ; / g, '<$1>' ) ;
140+ } else {
141+ return suggestion . value ;
142+ }
139143 } ;
140144
141145 Autocomplete . prototype = {
You can’t perform that action at this time.
0 commit comments