Cleaning smart tags when pasting from MS-Word

  •  12-15-2004, 1:12 PM

    Cleaning smart tags when pasting from MS-Word

    We have experienced some occasional difficulties when pasting in Word documents where the resulting XHTML does not validate. We have concluded that the source of these difficulties are the "smart tags" that Word embeds in the document.
    (These are of the form: <?xml:namespace prefix=st1 ><st1:City w:st> ... )
    Now, the onpaste event calls the oneditorpaste( string ) function in WinIE.js.
    In the onEditorPaste function the following line is commented out:

    // sandbox.innerHTML = cleantool( sHTML ) ; removeword

    and replaced with
    and replaced with
    sandbox.innerHTML = removeword( sHTML ) ;

    the primary difference between the cleantool function and the removeword function, is that the removeword function does *not* remove smart tags (using the  /<st1:.*?>/gi regex);
     
    My question is: Why does the removeword function not remove smart tags?
     
    Thanks for any help you can provide.
View Complete Thread