2

I have a application using the CK editor, where users typically paste content from word. When the paste from word function is used, then the content is cleaned properly. The problem is with users not using paste from word, then the HTML gets into a state that our application can't clean.

Has anyone found out a way of either forcing using paste from word for word content or automatically apply the logic used when paste from word, even if paste is directly into editor?

I would not like to completely turn off paste into the editor directly, rather I'd like to detect a word paste and then clean the data (as paste from word), or disallowing a paste from word but allowing normal text paste.

I'm using version 3.0.1 CK editor

1 Answer 1

0

Figured out that this was included in version 3.1 of CK Editor, then all paste in to normal edit window is passed through the word clean up function.

4
  • right, once you add c.extraPlugins = "pastefromword" to have it be loaded.
    – Kevin
    Mar 18, 2011 at 18:39
  • I think that should be the default behavior. CK editor checks if pasted HTML looks like coming from word, then it cleans it to "normal" HTML
    – Tomas
    Mar 25, 2011 at 13:31
  • 2
    For anyone looking to force this behaviour on everything (not only text copied from Word). I've posted my solution here: stackoverflow.com/a/8379364/407938
    – Keyvan
    Dec 5, 2011 at 13:25
  • i want to paster as it is any idea paste for word not working May 27, 2020 at 5:46

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.