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

Clipboard text styling is not stripped propely when pasting from other editor #45

Open
antoKeinanen opened this issue Nov 16, 2022 · 5 comments
Assignees
Labels
bug Something isn't working editor

Comments

@antoKeinanen
Copy link
Contributor

When pasting text with styling to the document the text styling is not removed. This will lead to the line not saving correctly and possibly the wole line breaking.

The pasted data will not be added to window.internal.ui.editor.getContent() and thus will not be saved correctly.

Steps to reproduce

  1. Open rich text editor like google docs
  2. Enter some text with styling like font size or colour.
  3. Copy and paste it to the editor.

image
v3 matikkaeditori fi_

@Esinko
Copy link
Member

Esinko commented Nov 16, 2022

We won't for now support any text styling, however this is a nice feature addition to be added later on.
I propose we change the paste action to remove all style information from the text while pasting text to the editor.
Would this solve your issue?

@DrVilepis
Copy link
Member

This reminds me...
kuva

@antoKeinanen
Copy link
Contributor Author

antoKeinanen commented Nov 16, 2022

I propose we change the paste action to remove all style information from the text while pasting text to the editor. Would this solve your issue?

I will make the required patches and start testing. You can assign the issue to me!

@antoKeinanen
Copy link
Contributor Author

We won't, for now, support any text styling, however, this is a nice feature addition to be added later on.

I propose that we could implement some subset of markdown, but I'll open another issue labeled as enhancement later to discuss this later.

@Esinko
Copy link
Member

Esinko commented Nov 16, 2022

We won't, for now, support any text styling, however, this is a nice feature addition to be added later on.

I propose that we could implement some subset of markdown, but I'll open another issue labeled as enhancement later to discuss this later.

Sure! Be aware of the existing on-paste listener in editor.js.

@Esinko Esinko added bug Something isn't working editor labels Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editor
Projects
None yet
Development

No branches or pull requests

3 participants