Testausserveri / matikkaeditori.fi

Online math notebook based on familiar Abitti editor
https://matikkaeditori.fi
GNU General Public License v3.0
11 stars 3 forks source link

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

Open antoKeinanen opened 2 years ago

antoKeinanen commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

This reminds me... kuva

antoKeinanen commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.