Source code at https://github.com/willemmulder/FilteredPaste.js
FilteredPaste.js is a jQuery plugin that filters any pasted input so that your application gets clean input, without any tags or attributes that you don't want. It supports native undo with control+z. IE and Opera are not supported yet.
Comes with a default filter that
FilteredPaste also allows for custom filters. See below examples for how that works!
This is a snippet you could copy. It has custom styling that you don't want and way too much whitespace between lines.
This is how pasting works without FilteredPaste
And this is how it works *with* FilteredPaste