简体   繁体   中英

cleaning up content pasted from MS Word

I'm looking for a server-side (C#) approach to cleaning up content pasted from MS Word. I know that a lot of the Rich Text Editors like FCKEdit have this ability built in, but I'd like to handle it on the backend to make it as seamless as possible to the user.

Jeff posted an approach to doing this

http://www.codinghorror.com/blog/archives/000485.html

but that's over three years old. Are there any better approaches to doing this?

Having had to deal with similar things in the past (and generally stuck with the editor's built in options), I'd say that Jeff's regex collection looks about right - I've not tested it, but it seems to cover most of the weird markup (all the <o:p> type tags for example) that word adds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM