When users cut content from outside sources, like a MS Word doc or another web page, then post that content into the Wordpress WYSIWYG editor, it also pastes a ton of bloated formatting code that skews the format of the published post.
I'm looking for a plugin that addresses this.
If there's no plugin available, I'd have to build one. The best option I can think of is to use javascript/jQuery to strip the formatting before the post is submitted. I would likely use keyUp() and keyDown() to catch the new content as it's pasted.
Step 1: Save cursor position upon keyDown()
Step 2: Save cursor position upon keyUp()
Step 3: Use regex to strip formatting from everything between keyUp and keyDown.
This would allow me to operate exclusively on the freshly pasted content while keeping the formatting the user has previously created via the WYSIWYG.
Though it seems using Javascript/jQuery to record cursor positions within a string is more complicated than I would've expected.
Preferably, I like suggestions for a plugin that is ready to go. But if not, are there any tips on what functions I should use to catch these cursor positions?