Table of Contents

Class FormatExtensions

Namespace
AngleSharp
Assembly
AngleSharp.dll

Extensions for formatting, e.g., markup or styling.

public static class FormatExtensions
Inheritance
FormatExtensions
Inherited Members

Methods

Minify(IMarkupFormattable)

Returns a minified serialization of the node guided by the MinifyMarkupFormatter with the default options.

public static string Minify(this IMarkupFormattable markup)

Parameters

markup IMarkupFormattable

The markup node to format.

Returns

string

The source code snippet.

Prettify(IMarkupFormattable)

Returns a prettified serialization of the node guided by the PrettyMarkupFormatter with the default options.

public static string Prettify(this IMarkupFormattable markup)

Parameters

markup IMarkupFormattable

The markup node to format.

Returns

string

The source code snippet.

ToCss(IStyleFormattable)

Returns the (complete) CSS style representation of the node.

public static string ToCss(this IStyleFormattable style)

Parameters

style IStyleFormattable

The style node to format.

Returns

string

The source code snippet.

ToCss(IStyleFormattable, IStyleFormatter)

Returns the (complete) CSS style representation of the node.

public static string ToCss(this IStyleFormattable style, IStyleFormatter formatter)

Parameters

style IStyleFormattable

The style node to format.

formatter IStyleFormatter

The formatter to use.

Returns

string

The source code snippet.

ToCss(IStyleFormattable, TextWriter)

Writes the serialization of the node guided by the formatter.

public static void ToCss(this IStyleFormattable style, TextWriter writer)

Parameters

style IStyleFormattable

The style node to format.

writer TextWriter

The output target of the serialization.

ToCssAsync(IStyleFormattable, Stream)

Writes the serialization of the node guided by the formatter to the given stream.

public static Task ToCssAsync(this IStyleFormattable style, Stream stream)

Parameters

style IStyleFormattable

The style node to format.

stream Stream

The output stream to use.

Returns

Task

ToCssAsync(IStyleFormattable, TextWriter)

Writes the serialization of the node guided by the formatter.

public static Task ToCssAsync(this IStyleFormattable style, TextWriter writer)

Parameters

style IStyleFormattable

The style node to format.

writer TextWriter

The output target of the serialization.

Returns

Task

ToHtml(IMarkupFormattable)

Returns the (complete) HTML markup representation of the node.

public static string ToHtml(this IMarkupFormattable markup)

Parameters

markup IMarkupFormattable

The markup node to format.

Returns

string

The source code snippet.

ToHtml(IMarkupFormattable, IMarkupFormatter)

Returns the serialization of the node guided by the formatter.

public static string ToHtml(this IMarkupFormattable markup, IMarkupFormatter formatter)

Parameters

markup IMarkupFormattable

The markup node to format.

formatter IMarkupFormatter

The formatter to use.

Returns

string

The source code snippet.

ToHtml(IMarkupFormattable, TextWriter)

Writes the serialization of the node guided by the formatter.

public static void ToHtml(this IMarkupFormattable markup, TextWriter writer)

Parameters

markup IMarkupFormattable

The markup node to format.

writer TextWriter

The output target of the serialization.

ToHtmlAsync(IMarkupFormattable, Stream)

Writes the serialization of the node guided by the formatter to the given stream.

public static Task ToHtmlAsync(this IMarkupFormattable markup, Stream stream)

Parameters

markup IMarkupFormattable

The markup node to format.

stream Stream

The output stream to use.

Returns

Task

ToHtmlAsync(IMarkupFormattable, TextWriter)

Writes the serialization of the node guided by the formatter.

public static Task ToHtmlAsync(this IMarkupFormattable markup, TextWriter writer)

Parameters

markup IMarkupFormattable

The markup node to format.

writer TextWriter

The output target of the serialization.

Returns

Task