Table of Contents

Interface IMarkupFormatter

Namespace
AngleSharp
Assembly
AngleSharp.dll

Basic interface for HTML node serialization.

public interface IMarkupFormatter
Extension Methods

Methods

CloseTag(IElement, bool)

Formats closing a tag with the given name.

string CloseTag(IElement element, bool selfClosing)

Parameters

element IElement

The element to close.

selfClosing bool

Is the element actually self-closing?

Returns

string

The formatted closing tag.

Comment(IComment)

Formats the given comment.

string Comment(IComment comment)

Parameters

comment IComment

The comment to stringify.

Returns

string

The formatted comment.

Doctype(IDocumentType)

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

string Doctype(IDocumentType doctype)

Parameters

doctype IDocumentType

The document type to stringify.

Returns

string

The formatted doctype.

LiteralText(ICharacterData)

Emits the text literally.

string LiteralText(ICharacterData text)

Parameters

text ICharacterData

The text to return.

Returns

string

The contained text.

OpenTag(IElement, bool)

Formats opening a tag with the given name.

string OpenTag(IElement element, bool selfClosing)

Parameters

element IElement

The element to open.

selfClosing bool

Is the element actually self-closing?

Returns

string

The formatted opening tag.

Processing(IProcessingInstruction)

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

string Processing(IProcessingInstruction processing)

Parameters

processing IProcessingInstruction

The processing instruction to stringify.

Returns

string

The formatted processing instruction.

Text(ICharacterData)

Formats the given text.

string Text(ICharacterData text)

Parameters

text ICharacterData

The text to sanitize.

Returns

string

The formatted text.