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.
@@ -1319,15 +1319,29 @@ class ElTextEditorComponent {
1319
1319
  else if (item.type === "text/html") {
1320
1320
  console.log("HTML data detected!");
1321
1321
  // Handle HTML paste
1322
- const htmlData = clipboardData.getData("text/html");
1323
- 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);
1324
1331
  return;
1325
1332
  }
1326
1333
  else if (item.type === "text/plain") {
1327
1334
  console.log("Plain text detected!");
1328
1335
  // Handle plain text paste
1329
- const plainText = clipboardData.getData("text/plain");
1330
- 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);
1331
1345
  return;
1332
1346
  }
1333
1347
  }