string input = ""; string sanitizedInput = SimpleHtml5Sanitizer.Sanitize(input); // Output: ""
var sanitizer = new HtmlSanitizer(); sanitizer.AllowAttributes("class"); sanitizer.AllowTags("p", "a"); string input = ""; string sanitizedInput = SimpleHtml5Sanitizer.Sanitize(input, sanitizer); // Output: ""In this example, the sanitizer is configured to only allow the "p" and "a" tags, as well as the "class" attribute. The input string contains a "p" tag with a "class" attribute, and an "a" tag with an "href" attribute. Since both of these tags and attributes are allowed, the input is not modified and the sanitized input string is the same as the original input. The SimpleHtml5Sanitizer class is part of the HtmlSanitizer package library.