由tinnymce编写的文本在asp.net mvc中显示格式不正确
我使用 Tinymce 在我的 asp.net mvc 应用程序中编辑文章正文。我还将 [ValidateInput(false)] 放在“编辑”操作结果上,并且没有收到任何错误,但是当我想向用户显示文章正文时,即使使用 Html.Raw(article.Body),它也会显示原始 html标签而不是格式化的文本。这是输出的示例:
<p><span style="text-decoration: underline;"><strong>dsadad asdsadad asdsadadad</strong></span></p>
ps:我使用 AntiXss 库。
I use Tinymce to edit article body in my asp.net mvc application. I also put [ValidateInput(false)] on 'Edit' Action result, and I get no errors, but When I want to show the article body to user, even by using Html.Raw(article.Body), it show raw html tags and not the formaytted text. Here is a example of out put:
<p><span style="text-decoration: underline;"><strong>dsadad asdsadad asdsadadad</strong></span></p>
ps: I use AntiXss library.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来 AntiXss 正在对 HTML 进行编码,因此
<
将变为<
。要将其解码回 HTML,请尝试以下操作:It looks like AntiXss is encoding the HTML so
<
will become<
. To decode it back to HTML, try this: