views:

61

answers:

0

I am trying to remove all font formatting styles upon doing ANY paste into FCKeditor. Specifically because of the inconsistent way FCKeditor handles pasting between browsers when pasting from Word using different methods (using the toolbar button, Ctrl+V, or the edit menu).

I read this http://drupal.org/node/630156 specifically the comment #3.

// ES 2009-11-12: remove color, size attributes from font tags:
html = html.replace( /\s*color="[^"]*"/gi, '' ) ;
html = html.replace( /\s*color=[^ >]*/gi, '' ) ;
html = html.replace( /\s*size="[^"]*"/gi, '' ) ;
html = html.replace( /\s*size=[^ >]*/gi, '' ) ;
html = html.replace( /\s*size="+[^"]*"/gi, '' ) ;
// ES 2009-11-12: Remove empty paragraphs
html = html.replace( /<p\s*[^>]*>&nbsp;<\/p>/gi, '' ) ;

I tried putting that regex into the CleanWord function in fck_paste.html as directed, but it seemed to have no effect when pasting from Word. Furthermore, that was only pasting from Word, I'd like to do this anytime the pasting occurs but don't know how to accomplish that. How can I do this? Also I am using the .net control if that helps.