3
votes

Problem: When a user copies a load of code from another website and pastes it into CKEditor it includes a load of inline styles which refer to the style of the content on the website it was copied from. When the pasted content is then saved and shown on my website it doesn't use my styles but the copied inline ones which conflict.

I've had a look through the CKEditor documentation, and to be honest I don't find the documentation to narrow down to what I'm looking for. There is a paste function available which removes formatting but this is an optional button in the menu, whereas most users will just post into the main large area, so its pretty worthless.

Main Question: is there a way to set CKEditor to strip formatting when pasting?

1

1 Answers

9
votes

Ah, I found the answer:

// Apply editor instance settings.
CKEDITOR.config.forcePasteAsPlainText = true;