Bug 443108 - Ability to copy tables with original formatting
Summary: Ability to copy tables with original formatting
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-29 07:31 UTC by Thiago Sueto
Modified: 2021-09-30 11:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.18.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Sueto 2021-09-29 07:31:20 UTC
SUMMARY
KMail should be able to show HTML tables with their original formatting to copy so that it can be copied and used on other applications, such as LibreOffice Calc / Softmaker Office / WPS Office.

So far I've avoided this issue by using gmail.com or Thunderbird, but doing this from KMail would be vital for me to accomplish an efficient workflow. While working at my previous company for three years this little functionality was extensively used in the entire company for job and work hours management. Currently, after selecting text in the message viewer of KMail, it is only possible to copy it as plain text. Online email clients such as Gmail and Roundcube allow you to copy HTML with the original formatting; desktop email clients like Outlook and Thunderbird allow for it too.

My use case was simple (and still is) and goes as follows:

* Company administration uses spreadsheets to save information about jobs, they send this data to my coordinator who then creates their own spreadsheet, and who then sends only the relevant jobs to me.
* My coordinator addresses an email to me, copies information about it from their Excel spreadsheet, paste on their email client (either web client or Outlook).
* I open the new email containing job information and copy that table.
* I then paste it in my own spreadsheet without having to manually enter every part of it.

This is extremely simple, but very effective. It reduces time spent on formatting and removes inconsistency, as all tables use the same scheme, so information is easily identifiable.

I am pretty sure this is an issue with how KMail display messages, because Klipper can copy tables just fine if it's from other sources (as mentioned, other email clients or website). If I copy a formatted table and then paste it in the KMail composer while Rich Text is enabled, it detects and displays things properly.

I am not the only one to needs this, either: https://www.reddit.com/r/kde/comments/mim5th/kmail_copying_table_from_html_email_to_libreoffice/

STEPS TO REPRODUCE
1. Open an email containing a formatted spreadsheet table
2. Copy that table
3. Paste it elsewhere where formatting can be detected, like an email client or spreadsheet editor.

OBSERVED RESULT
Table is pasted as plain text.

EXPECTED RESULT
Table is pasted with original formatting.
Comment 1 Thiago Sueto 2021-09-29 08:04:15 UTC
> I am not the only one to needs this, either:
> https://www.reddit.com/r/kde/comments/mim5th/
> kmail_copying_table_from_html_email_to_libreoffice/

To clarify, I meant to say I'm not the only one who has a need to copy tables from KMail to elsewhere. (The issue mentioned here is different from the reddit post)
Comment 2 Laurent Montel 2021-09-30 11:00:15 UTC
Hi,
Can you provide me an example of email with a table ?

Regards.
Comment 3 Laurent Montel 2021-09-30 11:20:03 UTC
Git commit e298890ab0ac7d44a425fb17c04b19dc9f45ab9f by Laurent Montel.
Committed on 30/09/2021 at 11:19.
Pushed by mlaurent into branch 'release/21.08'.

Fix Bug 443108 - Ability to copy tables with original formatting
FIXED-IN: 5.18.2

M  +1    -5    messageviewer/src/viewer/viewer_p.cpp

https://invent.kde.org/pim/messagelib/commit/e298890ab0ac7d44a425fb17c04b19dc9f45ab9f