Skip to content

Commit f91d60a

Browse files
authored
fix: Table copy paste into spreadsheets (#1298) (#1319)
* fix: Add <table> wrapping element when copying * test: Update snapshots
1 parent c2beb7c commit f91d60a

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr>
1+
<table><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<tr><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr>
1+
<table><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr>
1+
<table><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table>

packages/core/src/api/clipboard/toClipboard/copyExtension.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ function fragmentToExternalHTML<
8080
editor.schema.styleSchema
8181
);
8282

83-
externalHTML = externalHTMLExporter.exportInlineContent(ic as any, {});
83+
externalHTML = `<table>${externalHTMLExporter.exportInlineContent(
84+
ic as any,
85+
{}
86+
)}</table>`;
8487
} else if (isWithinBlockContent) {
8588
// first convert selection to blocknote-style inline content, and then
8689
// pass this to the exporter

0 commit comments

Comments
 (0)