diff --git a/src/HtmlSanitizer/IHtmlSanitizer.cs b/src/HtmlSanitizer/IHtmlSanitizer.cs index 0b3ee79..18c1e47 100644 --- a/src/HtmlSanitizer/IHtmlSanitizer.cs +++ b/src/HtmlSanitizer/IHtmlSanitizer.cs @@ -1,5 +1,6 @@ using AngleSharp; using AngleSharp.Dom.Css; +using AngleSharp.Dom.Html; using AngleSharp.Parser.Html; using System; using System.Collections.Generic; @@ -96,6 +97,11 @@ namespace Ganss.XSS /// ISet AllowedCssClasses { get; } + /// + /// Occurs after sanitizing the document and post processing nodes. + /// + event EventHandler PostProcessDom; + /// /// Occurs for every node after sanitizing. /// @@ -139,5 +145,22 @@ namespace Ganss.XSS /// The formatter used to render the DOM. Using the default formatter if null. /// The sanitized HTML. string Sanitize(string html, string baseUrl = "", IMarkupFormatter outputFormatter = null); + + /// + /// Sanitizes the specified HTML body fragment. If a document is given, only the body part will be returned. + /// + /// The HTML body fragment to sanitize. + /// The base URL relative URLs are resolved against. No resolution if empty. + /// The sanitized HTML Document. + IHtmlDocument SantizeDom(string html, string baseUrl = ""); + + /// + /// Sanitizes the specified HTML document. Even if only a fragment is given, a whole document will be returned. + /// + /// The HTML document to sanitize. + /// The base URL relative URLs are resolved against. No resolution if empty. + /// The formatter used to render the DOM. Using the if null. + /// The sanitized HTML document. + string SanitizeDocument(string html, string baseUrl = "", IMarkupFormatter outputFormatter = null); } } \ No newline at end of file