FYI, TinyMCE has improved this by implementing it as a default option in the paste plugin.
More info: http://www.tinymce.com/wiki.php/Plugin:paste
However, it's still not perfect.
So here is a script that also trips off all HTML:
// Paste
paste_auto_cleanup_on_paste : true,
paste_remove_spans: true,
paste_remove_styles: true,
paste_retain_style_properties: false,
paste_preprocess : function(pl, o)
{ // Replace <div> with <p>
o.content = o.content.replace(/<div>/gi, "<p>");
o.content = o.content.replace(/<\/div>/gi, "</p>");
o.content = o.content.replace(/<\r\n/gi, "\n");
o.content = o.content.replace(/<\n\n/gi, "\n");
o.content = o.content.replace(/<\n\n/gi, "\n");
// Replace empty styles
o.content = o.content.replace(/<style><\/style>/gi, "");
o.wordContent = true;
},
paste_postprocess : function(pl, o)
{ //console.log(o.node.innerHTML);
var ed = pl.editor, dom = ed.dom;
// Remove all tags which are not <p> or <br>
tinymce.each(dom.select('*', o.node), function(el)
{ if (el.tagName.toLowerCase() != "p" && el.tagName.toLowerCase() != "br")
{ dom.remove(el, 1); // 1 = KeepChildren
console.log(el.tagName);
}
dom.setAttrib(el, 'style', '');
});
},
Source:
http://www.tinymce.com/forum/viewtopic.php?pid=60121#p60121