开发者

AntiXss and my desired results

After scrubbing my field with AntiXss.HtmlEncode is there a way to remove all the开发者_StackOverflow社区 html elements because they still show up as literals in the display?


No, there isn't. If you want to remove HTML elements and then HtmlEncode the result, you have to actually parse the code and remove the elements.

You can use the HTML Agility Pack or any other HTML parser to parse the content, get the InnerText of the root element (this will be only the text of the content) and then call AntiXss.HtmlEncode on that result.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜