I have made some progress in having the editor automatically apply the word cleaning upon a paste from word. I can get it to apply this without having to prompt the user or do a second past in the paste from word dialog box. However, the function for GetClipboardHTML will sometimes return different HTML than would have been normally pasted into a regular DIV or the editor. Does anyone have an idea of how to grab the HTML content of the clipbaord without it being subjected to some changes?
The specific issue seems to be that when a Word style includes the text formatting (e.g. Bold, Italic, Underline), that doesn't also include inserting the STRONG tag, where a normal paste to a DIV would include that.
The clipboard fetch currently uses this code:
var oTextRange = document.body.createTextRange() ;
oTextRange.moveToElementText( oDiv ) ;
oTextRange.execCommand( 'Paste' ) ;
var sData = oDiv.innerHTML ;
The specific issue seems to be that when a Word style includes the text formatting (e.g. Bold, Italic, Underline), that doesn't also include inserting the STRONG tag, where a normal paste to a DIV would include that.
The clipboard fetch currently uses this code:
var oTextRange = document.body.createTextRange() ;
oTextRange.moveToElementText( oDiv ) ;
oTextRange.execCommand( 'Paste' ) ;
var sData = oDiv.innerHTML ;