예제 #1
0
    public static string Sanitize(string input)
    {
        if (input.Trim().Length < 1)
        {
            return(string.Empty);
        }
        var htmlDocument = new HtmlDocument();

        htmlDocument.LoadHtml(input);
        SanitizeNode(htmlDocument.DocumentNode);
        string xPath = HtmlSanitizer.CreateXPath();

        return(StripHtml(htmlDocument.DocumentNode.WriteTo().Trim(), xPath));
    }