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.
@@ -1313,19 +1313,36 @@ class ElTextEditorComponent {
1313
1313
  this.insertHtmlAtCaret(imgHtml);
1314
1314
  };
1315
1315
  reader.readAsDataURL(file);
1316
+ return;
1316
1317
  }
1317
1318
  }
1318
1319
  else if (item.type === "text/html") {
1319
1320
  console.log("HTML data detected!");
1320
1321
  // Handle HTML paste
1321
- const htmlData = clipboardData.getData("text/html");
1322
- this.insertHtmlAtCaret(htmlData);
1322
+ // const htmlData = clipboardData.getData("text/html");
1323
+ if (this.isTableData(clipboardData.getData('text/html'))) {
1324
+ const html = this.convertTextToTable(clipboardData.getData('text/html'));
1325
+ this.insertHtmlAtCaret(html);
1326
+ }
1327
+ else {
1328
+ this.insertHtmlAtCaret(clipboardData.getData('text/html'));
1329
+ }
1330
+ // this.insertHtmlAtCaret(htmlData);
1331
+ return;
1323
1332
  }
1324
1333
  else if (item.type === "text/plain") {
1325
1334
  console.log("Plain text detected!");
1326
1335
  // Handle plain text paste
1327
- const plainText = clipboardData.getData("text/plain");
1328
- this.insertHtmlAtCaret(plainText);
1336
+ if (this.isTableData(clipboardData.getData('text/plain'))) {
1337
+ const html = this.convertTextToTable(clipboardData.getData('text/plain'));
1338
+ this.insertHtmlAtCaret(html);
1339
+ }
1340
+ else {
1341
+ this.insertHtmlAtCaret(clipboardData.getData('text/plain'));
1342
+ }
1343
+ // const plainText = clipboardData.getData("text/plain");
1344
+ // this.insertHtmlAtCaret(plainText);
1345
+ return;
1329
1346
  }
1330
1347
  }
1331
1348
  }