How to sanitize input from MCE in ASP.NET?

前端 未结 2 1946
灰色年华
灰色年华 2020-12-11 06:41

Is there a utility/function in C# to sanitize the source code of tinyMCE rich text. I would like to remove dangerous tags but like to whitelist safe html tags.

2条回答
  •  情歌与酒
    2020-12-11 07:37

    Sanitizing an Html document involves a lot of tricky things. This package maybe of help: https://github.com/mganss/HtmlSanitizer I use it for a project of my own.

提交回复
热议问题