Excel 365 copy/paste to discourse not creating table

Hello,

So I’ve just upgraded from Office 2013 to Office 365.
Now when I copy cells from Excel 365 to Discourse I get an image and plain text.
When I copy from Excel 2013 I get Discourse cells in my post, I liked this but can’t get that now with 365.
Any clue how I can fix this?

Excel 365:
image Some test
of cells

Excel 2013:

some test
of cells
5 Likes

I believe @vinothkannans has fixed similar issues in the past, the tricky thing is that office loves putting lots and lots of different formats in the clipboard and it is hard to find the right one.

5 Likes

Here’s my version

Demo sheet

Result of pasting

![image|241x69](upload://6hbMkHa919qp5RLB4oJoa6OdORz.png) some test of cells

|image some |test|
|—|---|
|of |cells|

You should revisit this @vinothkannans

5 Likes

This issue should be fixed by the open PR of @joffreyjaffeux.

It is having a markdown table and image combination :confused:
Is it a different copy/paste issue from the above one?

4 Likes

That is the Windows 10 behavior. No idea what Mac behavior is.

6 Likes

I’ve seen this issue from Excel for months. Google Drive works just fine, so I’ve been copying from Excel to Google to Discourse when I need to paste a table. Pretty sure there’s an open bug for this, can’t find it though.

8 Likes

I think Windows likes putting stuff in lots of different clipboards sections associated to various types. Our JS piece needs to be able to handle that and only ever pick a single clipboard section.

We already try only to pick one format per:

https://github.com/discourse/discourse/blob/f1cd599966fc55102201161b877c3b25f0c1df5e/app/assets/javascripts/discourse/components/d-editor.js.es6#L847-L848

But maybe somehow we are also pasting the image here as well and should have some code that says… hi… I got text here… ignore the image.

4 Likes

I’m running into the same issue and found this which seems to work well with Excel 365:
https://github.com/jonmagic/copy-excel-paste-markdown

Perhaps some of this code can be used within Discourse.

4 Likes

@vinothkannans can we make progress on this before release date please?

7 Likes

https://github.com/discourse/discourse/commit/9c96511ec47bf0eb450a0b7e15738d284ee3761f

The above commit should resolve this issue. Now, we won’t include uploads if the plain text option is available. @user2 can you please confirm it?

12 Likes
Column A Column B Column C
A1 B1 C1
A2 B2 C2
A3 B3 C3
A4 B4 C4
A5 B5 C5

Looking good!

6 Likes

Testing libreoffice:

Hollywood Well
Screen Fair
Play Tooth
Marble Staff
Dinosaur Bill
Cat Shot
Pitch King
Bond Pan

Marvelous

:clap:

Super minor and unresolvable. We are unconditionally treating first row as “title” when in fact we may just be pasting in data. A tiny be of extra cutting and pasting can fix that, so I am not seeing it as a drama

6 Likes

It only appears to treated as a table if it is multi column or multirow.

A single column is fine:
1
2
3
4

As is a row:
1 2 3 4

A bulleted list:

  • 1Password
  • 1U Password Manager
  • DashLane

Mixed text:
Password managers:

  1. LastPass (Stored in the cloud) - https://www.lastpass.com/
  2. 1Password (Stored locally) - https://1password.com/
  3. KeePass (Opensource, stored locally) - http://keepass.info/

Yes, I did it purposely when I first developed this feature. Now I just forgot the reason :slight_smile:

Anyway, I will check the code later.

Sorry, I’m unable to understand these reports.

9 Likes

I wasn’t reporting a problem. I was only showing how it also worked correctly for text and didn’t cause any problem with markdown characters, i.e. the asterisk bullet point * .

5 Likes

This topic was automatically closed after 47 hours. New replies are no longer allowed.