csharp 代码删除所有无关的 Microsoft html 格式

发布于 2024-07-29 20:21:24 字数 121 浏览 1 评论 0原文

有没有什么方法可以以编程方式删除所有添加的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦里泪两行 2024-08-05 20:21:24

我使用了这些文章中的正则表达式:

就我而言,我想将每个人限制在一个小的标签白名单中。 尤其是那些从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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文