Q:

How to clean up HTML on-paste in my WYSIWYG editor

I have created a WYSIWYG HTML editor and I noticed that when you paste text from Word, it comes in with its source formatting and I don't want it. Is it possible to clean that up when it gets to the editor. 
What I need the most is being able to clean-up the text before it get to the editor itself. Something like an "onPaste" thing that can allow me to filter my text when it's pasted (using the command or keyboard shortcut).

A:

HTML Purifier will create standards compliant markup
http://htmlpurifier.org/
Or http://www.w3.org/People/Raggett/tidy/
If those don't help you, I suggest you switch to FCKEditor or tinymce which has this feature built-in.

