Interface
IHtmlParserProvider
OfficeIMO.Html.Dom
Parses inert HTML into an owned document. Implementations must perform no resource loading or script execution.
Methods
public abstract HtmlDocument ParseDocument(string source, HtmlParseOptions options, CancellationToken cancellationToken = default) #Parses a complete document and returns an immutable snapshot.
Parameters
- source string
- options OfficeIMO.Html.Dom.HtmlParseOptions
- cancellationToken System.Threading.CancellationToken = default
Returns
HtmlDocumentpublic abstract HtmlDocumentFragment ParseFragment(string source, HtmlElement contextElement, HtmlParseOptions options, CancellationToken cancellationToken = default) #Parses source with the supplied element as the HTML fragment-parsing context. The returned fragment belongs to an independent owned document and can be inserted with HtmlDocument.ImportNode.
Parameters
- source string
- contextElement OfficeIMO.Html.Dom.HtmlElement
- options OfficeIMO.Html.Dom.HtmlParseOptions
- cancellationToken System.Threading.CancellationToken = default
Returns
HtmlDocumentFragmentProperties
public abstract string Id { get; } #Identifies the parser implementation for diagnostics and reproducibility.