AngleSharp by Florian Rappl

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

 IMarkupFormatter

public interface IMarkupFormatter
Basic interface for HTML node serialization.
string CloseTag(IElement element, bool selfClosing)

Formats closing a tag with the given name.

string Comment(IComment comment)

Formats the given comment.

string Doctype(IDocumentType doctype)

Formats the given doctype using the name, public and system identifiers.

string OpenTag(IElement element, bool selfClosing)

Formats opening a tag with the given name.

Formats the given processing instruction using the target and the data.

string Text(string text)

Formats the given text.