Wysiwyg-editor: Weird issue with persistent style when copy and paste text

Created on 5 Jan 2021  路  2Comments  路  Source: froala/wysiwyg-editor

Expected behavior.

When I copy and paste text directly from Notebook (windows) or some other plain text editor, there should NOT be any style.

Actual behavior.

The inline style is pasted together for some really weird reason.

Steps to reproduce the problem.
  1. Copy a formatted text from a froala instance, something like this:
    <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue';">this is just a test!</p>

  2. Paste that text to Notepad or browser's address bar or any plain text editor so we can take out the format

  3. Copy the same text from the editor (with format should already by stripped out) and paste to another froala instance
  4. You will see that the same inline style is pasted along for some weird reason

(Note: step 1 is mandatory. If you just copy random text from plain text editor then things work as expected. I'm not sure if for some reason Froala keeps a copy of all text in the localStorage and mess things up for some reason?)

(Note 2: I did a quick test: I copied the text to the plain text editor, then simply modify 1-2 characters of the whole paragraph, then copied that and pasted without issue. That seems to have something with the way Froala seems to "remember" the last copied text)

Editor version.

3.2.5

OS.

Windows 10 (same issue on latest Mac OS)

Browser.

Chrome/Edge latest version

Most helpful comment

I think my issue is related to this: https://github.com/froala/wysiwyg-editor/issues/3806

The fix seems to work for me but as mentioned in the other issue, it's not an ideal fix.

Given that this is a commercial editor that we actually have to pay for, and that the issue was posted 1 year ago with a potential fix. What the .... guys? Please focus on fixing issues instead of chasing after new features. We need an editor that WORKS first, fancy features do not help if the basic features are not done right.

All 2 comments

I think my issue is related to this: https://github.com/froala/wysiwyg-editor/issues/3806

The fix seems to work for me but as mentioned in the other issue, it's not an ideal fix.

Given that this is a commercial editor that we actually have to pay for, and that the issue was posted 1 year ago with a potential fix. What the .... guys? Please focus on fixing issues instead of chasing after new features. We need an editor that WORKS first, fancy features do not help if the basic features are not done right.

~I'm seeing this as well (on 3.2.5-1), with the additional wrinkle that if you try to add formatting to pasted text it doesn't work, because the inline styles take precedence. E.g. If you copy and paste plain text within the Froala editor, you'll no longer be able to set e.g. paragraph header styles on the pasted text.~

Disregard this; I had introduced the above behavior myself by applying the workaround mentioned in #3806. Froala by default does not strip certain inline styles from HTML pasted from outside the editor; the fix for #3806 makes Froala handle HTML pasted between editors the same way.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thedotedge picture thedotedge  路  4Comments

horatiua picture horatiua  路  4Comments

Krisell picture Krisell  路  3Comments

lohiaad picture lohiaad  路  4Comments

Fandangi picture Fandangi  路  3Comments