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
ShouldKeepAttributeQuotes
Gets or sets if quotes of an attribute should be kept despite not needing them.
public bool ShouldKeepAttributeQuotes { get; set; }
Property Value
ShouldKeepComments
Gets or sets if comments should be preserved.
public bool ShouldKeepComments { get; set; }
Property Value
ShouldKeepEmptyAttributes
Gets or sets if empty (zero-length) attributes should be kept.
public bool ShouldKeepEmptyAttributes { get; set; }
Property Value
ShouldKeepImpliedEndTag
Gets or sets if implied end tags (e.g., "/li") should be preserved.
public bool ShouldKeepImpliedEndTag { get; set; }
Property Value
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
Methods
Attribute(IAttr)
Creates the string representation of the attribute.
protected override string Attribute(IAttr attr)
Parameters
attr
IAttrThe 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
Returns
- string
The formatted closing tag.
Comment(IComment)
Formats the given comment.
public override string Comment(IComment comment)
Parameters
comment
ICommentThe 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
Returns
- string
The formatted opening tag.
Text(ICharacterData)
Formats the given text.
public override string Text(ICharacterData text)
Parameters
text
ICharacterDataThe text to sanitize.
Returns
- string
The formatted text.