ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Support for pasting content from Excel

Open f1ames opened this issue 8 years ago • 18 comments

It would be nice to have support for pasting content from Excel (for features which are already available in the editor - tables, basic text styling, highlights, etc).

First it should be verified what already works out-of-the-box. Next step is to add support (proper content transformations on paste) for missing features.

Add 👍 if you'd like to see this feature.

f1ames avatar Oct 26 '18 08:10 f1ames

I have checked how pasting from Excel works. Unfortunately, the editor throws an error on paste:

image

It seems there are some text nodes inside <tbody> which should not be there, breaking the table conversions:

image

After adding some quickfix, table copied from excel is pasted, however text/cells styling is missing. It happens because all of the styling is applied through CSS classes not by inline styling which can be easily converted by the editor. Pasting:

image

result in:

image

and the clipboard content on paste (inner HTML of <body> only) is:

<table border=0 cellpadding=0 cellspacing=0 width=435 style='border-collapse:
collapse;width:326pt'>
    <!--StartFragment-->
    <col width=112 style='mso-width-source:userset;mso-width-alt:3584;width:84pt'>
    <col width=159 style='mso-width-source:userset;mso-width-alt:5077;width:119pt'>
    <col width=164 style='mso-width-source:userset;mso-width-alt:5248;width:123pt'>
    <tr height=21 style='height:16.0pt'>
        <td height=21 class=xl70 width=112 style='height:16.0pt;width:84pt'>foo</td>
        <td class=xl68 width=159 style='width:119pt'>bar</td>
        <td class=xl69 width=164 style='width:123pt'>baz</td>
    </tr>
    <tr height=21 style='height:16.0pt'>
        <td height=21 class=xl65 style='height:16.0pt'>foo2</td>
        <td class=xl66>bar2</td>
        <td class=xl67>ba<font class="font5">z2</font></td>
    </tr>
    <!--EndFragment-->
</table>

It will require some mechanism for styles inlining so then editor could correctly mapped styles in each element.

f1ames avatar Nov 07 '18 16:11 f1ames

It's enough for now if we preserve the structure table. So let's fix the crash first :D

Reinmar avatar Nov 07 '18 17:11 Reinmar

It's enough for now if we preserve the structure table. So let's fix the crash first :D

🤔 Should it be fixed in a way that we normalize pasted content or table converters should be fix to check node types more strictly? (I suppose the second approach may cover more cases in general) WDYT @Reinmar ?

f1ames avatar Nov 08 '18 07:11 f1ames

BTW, this is a DUP of https://github.com/ckeditor/ckeditor5-table/issues/145.

I don't know the code there, but generally speaking, the editor should not crash when loading incorrect data. So the bug is not in the normalization if you can reproduce it without pasting.

Reinmar avatar Nov 08 '18 09:11 Reinmar

any news on this topic? Paste from excel wihtout loosing formatting would be really good.

kevinclerc avatar Oct 29 '20 11:10 kevinclerc

Our users would like to have this fixed

jensen-lin avatar Feb 15 '21 09:02 jensen-lin

Hi! Our team will have to move to CKEditor 4 just because this issue :(

mmoroppa avatar May 11 '21 17:05 mmoroppa

Any idea if this is on the road map?

viz-eight7six avatar Jun 03 '21 23:06 viz-eight7six

Vote for the feature, our users prefer offline excel to work with tables and they want to share their tables via ckeEditor

BruTyler avatar Nov 16 '21 08:11 BruTyler

any update for this? if i paste from excel to word and from word to editor its save the style ^_^

kuku711 avatar Feb 16 '22 14:02 kuku711

Any word? Looks like it's been in progress for 4 years now

hajrice avatar May 20 '22 09:05 hajrice

Just voting for this. I use Excel all the time and this would be cool to have.

fpolli avatar Jun 10 '22 12:06 fpolli

Voting here

mikebpech avatar Oct 12 '22 18:10 mikebpech

Voting here for this feature

paulbenjamin3409 avatar Dec 20 '22 15:12 paulbenjamin3409

Voting for this. It is a nonstarter really - we shouldn't have to justify voting for this - why would you not support it?

aaronschubert avatar Feb 22 '23 22:02 aaronschubert

CKEditor dev team is truely adamant and not considering this ticket. Complete ignorance at such important feature.

vijendrapatil avatar Mar 01 '23 11:03 vijendrapatil

CKEditor dev team is truely adamant and not considering this ticket. Complete ignorance at such important feature.

@jacekbogdanski , JakeAlmer I have created a new ticket for the same.

https://github.com/ckeditor/ckeditor5/issues/13586

vijendrapatil avatar Mar 06 '23 09:03 vijendrapatil

Resolved by Paste from Office Enhanced :tada:

With this feature, the experience with style retention will now be much better.

Since the scope of this ticket wasn't defined, in case of any remaining issues that we didn't cover, please open new tickets.

Reinmar avatar Aug 22 '23 08:08 Reinmar