el-text-editor 0.0.56 → 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.
@@ -1323,15 +1323,29 @@ class ElTextEditorComponent {
1323
1323
  else if (item.type === "text/html") {
1324
1324
  console.log("HTML data detected!");
1325
1325
  // Handle HTML paste
1326
- const htmlData = clipboardData.getData("text/html");
1327
- 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);
1328
1335
  return;
1329
1336
  }
1330
1337
  else if (item.type === "text/plain") {
1331
1338
  console.log("Plain text detected!");
1332
1339
  // Handle plain text paste
1333
- const plainText = clipboardData.getData("text/plain");
1334
- 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);
1335
1349
  return;
1336
1350
  }
1337
1351
  }