el-text-editor 0.0.55 → 0.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1317,19 +1317,36 @@ class ElTextEditorComponent {
1317
1317
  this.insertHtmlAtCaret(imgHtml);
1318
1318
  };
1319
1319
  reader.readAsDataURL(file);
1320
+ return;
1320
1321
  }
1321
1322
  }
1322
1323
  else if (item.type === "text/html") {
1323
1324
  console.log("HTML data detected!");
1324
1325
  // Handle HTML paste
1325
- const htmlData = clipboardData.getData("text/html");
1326
- this.insertHtmlAtCaret(htmlData);
1326
+ // const htmlData = clipboardData.getData("text/html");
1327
+ if (this.isTableData(clipboardData.getData('text/html'))) {
1328
+ const html = this.convertTextToTable(clipboardData.getData('text/html'));
1329
+ this.insertHtmlAtCaret(html);
1330
+ }
1331
+ else {
1332
+ this.insertHtmlAtCaret(clipboardData.getData('text/html'));
1333
+ }
1334
+ // this.insertHtmlAtCaret(htmlData);
1335
+ return;
1327
1336
  }
1328
1337
  else if (item.type === "text/plain") {
1329
1338
  console.log("Plain text detected!");
1330
1339
  // Handle plain text paste
1331
- const plainText = clipboardData.getData("text/plain");
1332
- this.insertHtmlAtCaret(plainText);
1340
+ if (this.isTableData(clipboardData.getData('text/plain'))) {
1341
+ const html = this.convertTextToTable(clipboardData.getData('text/plain'));
1342
+ this.insertHtmlAtCaret(html);
1343
+ }
1344
+ else {
1345
+ this.insertHtmlAtCaret(clipboardData.getData('text/plain'));
1346
+ }
1347
+ // const plainText = clipboardData.getData("text/plain");
1348
+ // this.insertHtmlAtCaret(plainText);
1349
+ return;
1333
1350
  }
1334
1351
  }
1335
1352
  }