Text written by tinnymce is not displayed well formatted in asp.net mvc
I use Tinymce t开发者_StackOverflow中文版o 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.
It looks like AntiXss is encoding the HTML so <
will become <
. To decode it back to HTML, try this:
@Html.Raw(HttpUtility.HtmlDecode(article.Body))
精彩评论