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

forcePasteAsPlainText doesn't filter text pasted from word #1013

Closed
jswiderski opened this issue Oct 5, 2017 · 2 comments
Closed

forcePasteAsPlainText doesn't filter text pasted from word #1013

jswiderski opened this issue Oct 5, 2017 · 2 comments
Labels
status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Milestone

Comments

@jswiderski
Copy link
Contributor

Are you reporting a feature request or a bug?

Bug

Check if the issue is already reported

Provide detailed reproduction steps (if any)

  1. Set CKEditor configuration to:
var editor = CKEDITOR.replace( 'editor1', {
	forcePasteAsPlainText : true, 
	enterMode : CKEDITOR.ENTER_BR
});
  1. Load CKEditor sample in a browser and clear it contents.
  2. Paste contents of attached Word file
    test.docx

Expected result

Only text divided by BR tags gets pasted .

Actual result

Starting from CKEditor 4.5.0 tags like lists, tables or spans are no longer removed.

Other details

  • Browser: Any
  • OS: Any
  • CKEditor version: 4.5.0+
  • Installed CKEditor plugins: N/A

NOTE: The documentation for forcePasteAsplainText - https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.config-cfg-forcePasteAsPlainText still mentions PFW dialog which we have removed in version 4.7.0. If we are not going to bring it back (unless there is no other solution for mobiles), shouldn't we remove that information?

@mlewand mlewand added this to the 4.8.0 milestone Oct 5, 2017
@mlewand mlewand added target:minor Any docs related issue that can be merged into a master or major branch. status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. type:bug A bug. labels Oct 5, 2017
@mlewand mlewand changed the title forcePasteAsPlainText doesn't filter text pasted from word. forcePasteAsPlainText doesn't filter text pasted from word Oct 16, 2017
@mlewand
Copy link
Contributor

mlewand commented Oct 19, 2017

Yes, we need definitely update the docs referenced by @jswiderski.

The problem is that before 4.7.x we had this quirk that forcePasteAsPlainText would not have an effect if the content was pasted through the dialog.

Since 4.7.x we're very good at detecting content from MS Word on data-transfer enabled browsers. Thus we could provide a way to paste rich text (ignoring forcePasteAsPlainText) to people who enjoyed this function in pre-4.7.x releases.

We could do that with forcePasteAsPlainText accepting following vals:

  • false - editor allows for rich text pasting (though one needs to remember about paste filter)
  • true - no matter what, only plain text should be pasted as the config implies
  • 'allow-office' or 'ignore-office' (or replace "office" with "word") that settings works as true except it allows rich content pastes from Microsoft Office.

@f1ames f1ames self-assigned this Nov 10, 2017
@mlewand
Copy link
Contributor

mlewand commented Nov 22, 2017

Unfortunately we won't be able to fix this regression in this major release.

The good news is that it should not be very risky/API breaking change, so we should be able to include it in next minor release. So it will not be delayed by a long time.

Sorry for inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

3 participants