mail icon indicating copy to clipboard operation
mail copied to clipboard

Pasted markdown lists are not displayed in CKEditor

Open hamza221 opened this issue 1 year ago • 4 comments

Steps to reproduce

  1. Create a list in an external markdown editor
  2. Copy it
  3. Paste it in Composer

Expected behavior

Display the list correctly

Actual behavior

displayed as normal text no indication (*,- or 1.) that it's a list

Mail app version

No response

Mailserver or service

No response

Operating system

No response

PHP engine version

None

Web server

None

Database

None

Additional info

No response

hamza221 avatar Jul 15 '24 15:07 hamza221

Dup of https://github.com/nextcloud/mail/issues/9608

ChristophWurst avatar Jul 15 '24 15:07 ChristophWurst

fixed in https://github.com/nextcloud/mail/issues/9608

hamza221 avatar Jul 15 '24 15:07 hamza221

@hamza221 is this already deployed on c.nc.com? Cause I just pasted a copied markdown text and it did not copy the list formatting.

alexanderdd avatar Jul 29 '24 07:07 alexanderdd

I just copied a bullet list from an md document (app "Text") to an email on c.nc.com -> the bullet formatting was dropped.

Firefox 129. Cleared cache before.

alexanderdd avatar Aug 26 '24 13:08 alexanderdd

I was able to reproduce copying from the text app Not able to reproduce with other Markdown editors

hamza221 avatar Sep 23 '24 10:09 hamza221

Could this be a Text issue? Copying lists from Text to Talk is also kind of broken. Some list handles are lost, others are preserved.

ChristophWurst avatar Nov 13 '24 14:11 ChristophWurst

@alexanderdd copying lists from Text to the native Gnome text editor doesn't work either. Top level items lose their handle. Sub items remain lists.

Pasting a markdown list into CKEditor keeps the markdown format. I'd says that is somewhat expected because you don't copy a formatted string but "source code". We could consider detecting markdown and doing a conversion, as a feature.

ChristophWurst avatar Nov 13 '24 15:11 ChristophWurst

Sorry I don't understand what info you need. As a user, I expect that I can copy a bullet list from NC Text to NC Mail and formatting will be preserved. Not sure what needs to be done for this to work.

alexanderdd avatar Nov 13 '24 18:11 alexanderdd

Thank you for your feedback

ChristophWurst avatar Nov 13 '24 19:11 ChristophWurst

I still have this issue all the time when copying work reports from the Nextcloud Notes web editor into the Nextcloud Mail compose editor (Safari 18.1.1 (20619.2.8.11.12) as well as Google Chrome 131.0.6778.86 (Offizieller Build) (arm64)). I have rich text formatting for new messages enabled by default.

i2h3 avatar Nov 22 '24 15:11 i2h3

Thank you for the feedback @i2h3. When copying from Notes or Text the clipboard contains broken markdown. This markdown is taken as-is by our editor. For Notes/Text contents to be copy-pastable to Mail it would need the markdown text to be fully copyable, an automatic detection of markdown, and a conversion from markdown to HTML. This is what happens when you copy from Notes/Text to a local text editor: Image

As a counter example: go to https://www.w3schools.com/html/html_lists.asp and copy a list. Paste it into Mail. The bullet points are kept, because your clipboard will contain HTML. There is no conversion necessary.

tl;dr: the problem is the content copied from Notes/Text

ChristophWurst avatar Nov 26 '24 07:11 ChristophWurst

@ChristophWurst

tl;dr: the problem is the content copied from Notes/Text

So what is needed is a bug report in NC Text, correct? Can you do it? Otherwise I can do it.

alexanderdd avatar Nov 26 '24 12:11 alexanderdd

That is correct, @alexanderdd! I checked this morning and could not find any existing reports about this. Thanks for taking the lead on this.

ChristophWurst avatar Nov 26 '24 12:11 ChristophWurst

Well, that is funny… I started writing the issue for Nextcloud Text myself and while trying to reproduce the issue for exact descriptions of the steps involved it works. Copy and paste works from Nextcloud Text. 😕 Also from Nextcloud Notes. 😵‍💫 Both into macOS' TextEdit app, both plain and formatted text. But not into the editor of Nextcloud Mail. 🤔

I have to mention, though: Only works if the list is wrapped in other content like heading or normal paragraphs. If you only have a list and select only that for copying and pasting, it indeed does not copy a markdown list.

i2h3 avatar Nov 26 '24 13:11 i2h3

@i2h3 well observed.

We have to study where the formatting is dropped. https://ckeditor.com/ckeditor-5/demo/feature-rich/ does work with a copy-paste from Nextcloud Text (when using heading+list)

ChristophWurst avatar Nov 26 '24 13:11 ChristophWurst

so the story continues over here https://github.com/nextcloud/text/issues/6708

please upvote it, and maybe someone has the skill to tackle it? 💯

alexanderdd avatar Nov 27 '24 16:11 alexanderdd

I actually think this is a mail issue. Testing with https://ckeditor.com/ckeditor-5/demo/feature-rich/ I can confirm that copying form text works and also inspecting the clipboard content from text with https://evercoder.github.io/clipboard-inspector/ we properly pass over HTML and markdown including the list formatting.

juliusknorr avatar Dec 02 '24 11:12 juliusknorr

Just pasted some unnumbered lists from NC Text into Thunderbird - works fine.

So I reopen this. (also because of Julius' comment)

Should I close https://github.com/nextcloud/text/issues/6708 ?

alexanderdd avatar Dec 02 '24 12:12 alexanderdd

We have to study where the formatting is dropped. https://ckeditor.com/ckeditor-5/demo/feature-rich/ does work with a copy-paste from Nextcloud Text (when using heading+list)

Yes

ChristophWurst avatar Dec 02 '24 14:12 ChristophWurst