File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -356,6 +356,22 @@ the specific language governing permissions and limitations under the Apache Lic
356356 markup . push ( escapeMarkup ( text . substring ( match + tl , text . length ) ) ) ;
357357 }
358358
359+ function defaultEscapeMarkup ( markup ) {
360+ var replace_map = {
361+ '\\' : '\' ,
362+ '&' : '&' ,
363+ '<' : '<' ,
364+ '>' : '>' ,
365+ '"' : '"' ,
366+ "'" : ''' ,
367+ "/" : '/'
368+ } ;
369+
370+ return String ( markup ) . replace ( / [ & < > " ' \/ \\ ] / g, function ( match ) {
371+ return replace_map [ match ] ;
372+ } ) ;
373+ }
374+
359375 /**
360376 * Produces an ajax-based query function
361377 *
@@ -3091,21 +3107,7 @@ the specific language governing permissions and limitations under the Apache Lic
30913107 separator : "," ,
30923108 tokenSeparators : [ ] ,
30933109 tokenizer : defaultTokenizer ,
3094- escapeMarkup : function ( markup ) {
3095- var replace_map = {
3096- '\\' : '\' ,
3097- '&' : '&' ,
3098- '<' : '<' ,
3099- '>' : '>' ,
3100- '"' : '"' ,
3101- "'" : ''' ,
3102- "/" : '/'
3103- } ;
3104-
3105- return String ( markup ) . replace ( / [ & < > " ' \/ \\ ] / g, function ( match ) {
3106- return replace_map [ match ] ;
3107- } ) ;
3108- } ,
3110+ escapeMarkup : defaultEscapeMarkup ,
31093111 blurOnChange : false ,
31103112 selectOnBlur : false ,
31113113 adaptContainerCssClass : function ( c ) { return c ; } ,
@@ -3129,7 +3131,8 @@ the specific language governing permissions and limitations under the Apache Lic
31293131 tags : tags
31303132 } , util : {
31313133 debounce : debounce ,
3132- markMatch : markMatch
3134+ markMatch : markMatch ,
3135+ escapeMarkup : defaultEscapeMarkup
31333136 } , "class" : {
31343137 "abstract" : AbstractSelect2 ,
31353138 "single" : SingleSelect2 ,
You can’t perform that action at this time.
0 commit comments