csharp 代码删除所有无关的 Microsoft html 格式
有没有什么方法可以以编程方式删除所有添加的 microsoft html 格式并将其简单地呈现为常规 html。
我想删除所有额外的标签,因为我试图将其加载到tinymce中,但tinymce似乎无法渲染它。
is there any way to programatically remove all microsoft html formatting that gets put on and simply render it as regular html.
i want to remove all the extra tags as i am trying to load it into tinymce but tinymce doesn't seem to be able to render it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用了这些文章中的正则表达式:
就我而言,我想将每个人限制在一个小的标签白名单中。 尤其是那些从Word粘贴的。 TinyMCE 有一个属性“valid_elements”,它正是这样做的。
I've used the regular expressions from these articles:
In my case I wanted to restrict everyone down to a small whitelist of tags. Especially those who paste from Word. TinyMCE has a property "valid_elements" which does exactly this.