File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1261,7 +1261,7 @@ function join_pair(key, value) {
12611261 * @return {* } Encoded string or original value if not a string
12621262 */
12631263function escapeQuotes ( value ) {
1264- return isString ( value ) ? value . replace ( '"' , '"' ) . replace ( "'" , ''' ) : value ;
1264+ return isString ( value ) ? value . replace ( / \" / g , '"' ) . replace ( / \' / g , ''' ) : value ;
12651265}
12661266
12671267/**
Original file line number Diff line number Diff line change @@ -1158,7 +1158,7 @@ function join_pair(key, value) {
11581158 * @return {* } Encoded string or original value if not a string
11591159 */
11601160function escapeQuotes ( value ) {
1161- return isString ( value ) ? value . replace ( '"' , '"' ) . replace ( "'" , ''' ) : value ;
1161+ return isString ( value ) ? value . replace ( / \" / g , '"' ) . replace ( / \' / g , ''' ) : value ;
11621162}
11631163
11641164/**
Original file line number Diff line number Diff line change @@ -121,8 +121,8 @@ describe('image helper', function () {
121121 } ) ;
122122 it ( "should escape quotes in html attributes" , function ( ) {
123123 expect ( cloudinary . image ( "sample.jpg" , {
124- alt : "asdfg\"'asdf "
125- } ) ) . to . eql ( `<img src='${ UPLOAD_PATH } /sample.jpg' alt='asdfg" 'asdf '/>` ) ;
124+ alt : "here 'is' my \"alt\" escaped "
125+ } ) ) . to . eql ( `<img src='${ UPLOAD_PATH } /sample.jpg' alt='here 'is ' my "alt" escaped '/>` ) ;
126126 } ) ;
127127
128128 describe ( ":client_hints" , function ( ) {
You can’t perform that action at this time.
0 commit comments