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