# AngleSharpHtmlParser

Inert HTML parsing backed by AngleSharp, returning owned OfficeIMO document snapshots.

Class 

`OfficeIMO.Html.Providers`

**Namespace**

`OfficeIMO.Html.Providers`

**Assembly**

`OfficeIMO.Html.AngleSharp`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[AngleSharpHtmlParser.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Html.AngleSharp/AngleSharpHtmlParser.cs#L14)

**Implements**

`IHtmlParserProvider`

**Modifiers**

sealed

Inert HTML parsing backed by AngleSharp, returning owned OfficeIMO document snapshots.

## Inheritance

- object
- AngleSharpHtmlParser

## Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Property [AngleSharpHtmlParser.Instance](/api/html-angle-sharp/officeimo-html-providers-anglesharphtmlparser/#property-instance)

Filter members 

Show inherited

## Constructors

`public AngleSharpHtmlParser()` [#](#constructor-ctor)

## Methods

`public HtmlDocument ParseDocument(string source, HtmlParseOptions options, CancellationToken cancellationToken = default)` [#](#method-parsedocument-string-officeimo-html-dom-htmlparseoptions-threading-cancellationtoken)

[AngleSharpHtmlParser.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Html.AngleSharp/AngleSharpHtmlParser.cs#L14)

Parses a complete document and returns an immutable snapshot.

Parameters

**source string required**

**options OfficeIMO.Html.Dom.HtmlParseOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`HtmlDocument`

`public HtmlDocumentFragment ParseFragment(string source, HtmlElement contextElement, HtmlParseOptions options, CancellationToken cancellationToken = default)` [#](#method-parsefragment-string-officeimo-html-dom-htmlelement-officeimo-html-dom-htmlparseoptions-threading-cancellationtoken)

[AngleSharpHtmlParser.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Html.AngleSharp/AngleSharpHtmlParser.cs#L25)

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 required**

**contextElement OfficeIMO.Html.Dom.HtmlElement required**

**options OfficeIMO.Html.Dom.HtmlParseOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`HtmlDocumentFragment`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public static AngleSharpHtmlParser Instance { get; }` [#](#property-instance)

[AngleSharpHtmlParser.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Html.AngleSharp/AngleSharpHtmlParser.cs#L8)

Stateless default parser shared by conversion requests.

`public string Id { get; }` [#](#property-id)

[AngleSharpHtmlParser.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Html.AngleSharp/AngleSharpHtmlParser.cs#L10)

Identifies the parser implementation for diagnostics and reproducibility.

<!-- PowerForge markdown artifact sha256:A1217F0F0943A8D118389B1947DF94B1927698903165EDE27B32BFA27FEFC0C0 -->
