清理从 MS Word 粘贴的内容
我正在寻找一种服务器端 (C#) 方法来清理从 MS Word 粘贴的内容。 我知道很多富文本编辑器(例如 FCKEdit)都内置了此功能,但我想在后端处理它,以使其对用户尽可能无缝。
Jeff 发布了执行此操作的方法
但那已经三年多了。 有没有更好的方法来做到这一点?
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
but that's over three years old. Are there any better approaches to doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不得不处理类似过去的事情(并且通常坚持编辑器的内置选项),我想说杰夫的正则表达式集合看起来是正确的 - 我没有测试过它,但它似乎涵盖了大部分奇怪的标记(例如,word 添加的所有类型标签。
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.