Skip to content

Commit 63bbc18

Browse files
committed
Fixed Copy/paste issue with special characters #️⃣
1 parent 85760db commit 63bbc18

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

assets/js/xs-cp.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
function importContent( newWidget, elementCode, container ) {
2121

22-
var elementCodeStringify = JSON.stringify(elementCode);
22+
var elementCodeStringify = encodeURIComponent( JSON.stringify(elementCode) );
2323
var containsMedia = /png|gif|webp|tiff|psd|raw|bmp|heif|svg|jpg/.test(elementCodeStringify);
2424

2525
if ( containsMedia ) {
@@ -43,7 +43,7 @@
4343
})
4444
.catch(function(error) {
4545
console.log('Something went wrong!');
46-
console.log(JSON.stringify(error));
46+
console.log(error);
4747

4848
elementor.notifications.showToast({
4949
message: elementor.translate('#2 Something went wrong!')
@@ -200,7 +200,7 @@
200200
})
201201
.catch(function(error) {
202202
console.log('Something went wrong!');
203-
console.log(JSON.stringify(error));
203+
console.log(error);
204204
elementor.notifications.showToast({
205205
message: elementor.translate('#4 Something went wrong!')
206206
});

0 commit comments

Comments
 (0)