AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.5.1" />

 HtmlTokenizer

sealed class HtmlTokenizer : BaseTokenizer
Performs the tokenization of the source code. Follows the tokenization algorithm at: http://www.w3.org/html/wg/drafts/html/master/syntax.html
public bool AcceptsCharacterData { get; set; }

Gets or sets if CDATA sections are accepted.

public SourceManager Stream { get; }

Gets the underlying stream.

See 8.2.4 Tokenization

public HtmlToken Get()

Gets the next available token.

public void Switch(HtmlParseMode state)

Switches the current tokenization state to the desired content model.