Table of Contents

Class MinifyMarkupFormatter

Namespace
AngleSharp.Html
Assembly
AngleSharp.dll

Represents the an HTML5 markup formatter with a normalization scheme.

public class MinifyMarkupFormatter : HtmlMarkupFormatter, IMarkupFormatter
Inheritance
MinifyMarkupFormatter
Implements
Inherited Members
Extension Methods

Constructors

MinifyMarkupFormatter()

public MinifyMarkupFormatter()

Properties

PreservedTags

Gets or sets the tags that should have preserved white-space.

public IEnumerable<string> PreservedTags { get; set; }

Property Value

IEnumerable<string>

ShouldKeepAttributeQuotes

Gets or sets if quotes of an attribute should be kept despite not needing them.

public bool ShouldKeepAttributeQuotes { get; set; }

Property Value

bool

ShouldKeepComments

Gets or sets if comments should be preserved.

public bool ShouldKeepComments { get; set; }

Property Value

bool

ShouldKeepEmptyAttributes

Gets or sets if empty (zero-length) attributes should be kept.

public bool ShouldKeepEmptyAttributes { get; set; }

Property Value

bool

ShouldKeepImpliedEndTag

Gets or sets if implied end tags (e.g., "/li") should be preserved.

public bool ShouldKeepImpliedEndTag { get; set; }

Property Value

bool

ShouldKeepStandardElements

Gets or sets if the automatically inserted standard elements (html, head, body) should be kept despite adding no value.

public bool ShouldKeepStandardElements { get; set; }

Property Value

bool

Methods

Attribute(IAttr)

Creates the string representation of the attribute.

protected override string Attribute(IAttr attr)

Parameters

attr IAttr

The attribute to serialize.

Returns

string

The string representation.

CloseTag(IElement, bool)

Formats closing a tag with the given name.

public override 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.

public override string Comment(IComment comment)

Parameters

comment IComment

The comment to stringify.

Returns

string

The formatted comment.

OpenTag(IElement, bool)

Formats opening a tag with the given name.

public override 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.

Text(ICharacterData)

Formats the given text.

public override string Text(ICharacterData text)

Parameters

text ICharacterData

The text to sanitize.

Returns

string

The formatted text.