Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying text from collective page copies it as markdown when text is expected #1300

Closed
pascalBokBok opened this issue May 28, 2024 · 3 comments
Labels
bug Something isn't working needs info

Comments

@pascalBokBok
Copy link

Describe the bug
When you copy text from e.g. an instruction page with bullets you will get the formatting as part of it 1. 1. * * cp file.txt folder-name which makes unconvenient for storing text that can be copied.
This is a new behaviour. It used to copy fine on an earlier release.
I assume it was added to easily keep formatting when copying around in collectives. I suspect that the mimetype text/markdown should also be used when copy pasting within collectives.
something akin to:
event.clipboardData.setData('text/plain', selectedText); event.clipboardData.setData('text/html', htmlContent); event.clipboardData.setData('text/markdown', markdownContent);

To Reproduce
Steps to reproduce the behavior:

  1. In a page with bullets.
  2. mark the text of one of the bullets and copy it.
  3. paste into text editor
  4. See markdown formatting.

Expected behavior
text without markdown formatting.

Screenshots
If applicable, add screenshots to help explain your problem.

Server details:

  • Collectives app version: 2.11.0
  • Nextcloud version: 28
  • PHP Version: 8.1
  • Database: Postgresql

Client details:

  • OS: Linux
  • Browser: Chrome
  • Browser version: 124
  • Device: desktop
@pascalBokBok pascalBokBok added the bug Something isn't working label May 28, 2024
@mejo-
Copy link
Member

mejo- commented May 28, 2024

Dear @pascalBokBok, which Nextcloud version to you run? With Nextcloud 28.0.5, we added some related fixes. We discussed this behaviour extensively and decided to copy markdown in most cases but skip marks (like bold, italic, ...). In cases like bulletin lists or numbered lists, markdown actually makes more sense than just the plain text.

See nextcloud/text#5487 for some further context.

@pascalBokBok
Copy link
Author

Dear @mejo-
We're on 28.0.3. I didn't realize that it would influence this copy/paste in collectives. Will update that.

But, if I may ask, since it's part fixed. Why is it that you don't just store the both text/raw and text/markdown in the copy event instead of putting a hybrid into text/raw?
(also you store text/html already)
It's up to the receiving application to choose which of the mimetypes it prefer for the paste event.

@mejo-
Copy link
Member

mejo- commented May 29, 2024

We're on 28.0.3. I didn't realize that it would influence this copy/paste in collectives. Will update that.

Good news then, upgrading will solve your issue 😊

But, if I may ask, since it's part fixed. Why is it that you don't just store the both text/raw and text/markdown in the copy event instead of putting a hybrid into text/raw?

The reason is that text/markdown is not used by anyone, so storing data there would not help much. We want to have a readable text version in text/plain. It's not about copying between collectives pages. There we can rely on text/html which transfers all the formatting details. It's about copying to places that consume text/plain, like textfields on websites, some messaging clients, etc..

@mejo- mejo- closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs info
Projects
None yet
Development

No branches or pull requests

2 participants