Class HtmlMarkupFormatter
- Namespace
- AngleSharp.Html
- Assembly
- AngleSharp.dll
Represents the standard HTML5 markup formatter.
public class HtmlMarkupFormatter : IMarkupFormatter
- Inheritance
-
HtmlMarkupFormatter
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
HtmlMarkupFormatter()
public HtmlMarkupFormatter()
Fields
Instance
An instance of the HtmlMarkupFormatter.
public static readonly IMarkupFormatter Instance
Field Value
Methods
Attribute(IAttr)
Creates the string representation of the attribute.
protected virtual 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 virtual string CloseTag(IElement element, bool selfClosing)
Parameters
Returns
- string
The formatted closing tag.
Comment(IComment)
Formats the given comment.
public virtual string Comment(IComment comment)
Parameters
comment
ICommentThe comment to stringify.
Returns
- string
The formatted comment.
Doctype(IDocumentType)
Formats the given doctype using the name, public and system identifiers.
public virtual string Doctype(IDocumentType doctype)
Parameters
doctype
IDocumentTypeThe document type to stringify.
Returns
- string
The formatted doctype.
EscapeText(string)
Escapes the given text by replacing special characters with their HTML entity (amp, nobsp, lt, and gt).
public static string EscapeText(string content)
Parameters
content
stringThe string to alter.
Returns
- string
The altered string.
GetIds(string, string)
Gets the doctype identifiers from the given public and system identifier.
public static string GetIds(string publicId, string systemId)
Parameters
Returns
- string
The combined string representation.
LiteralText(ICharacterData)
Emits the text literally.
public virtual string LiteralText(ICharacterData text)
Parameters
text
ICharacterDataThe text to return.
Returns
- string
The contained text.
OpenTag(IElement, bool)
Formats opening a tag with the given name.
public virtual string OpenTag(IElement element, bool selfClosing)
Parameters
Returns
- string
The formatted opening tag.
Processing(IProcessingInstruction)
Formats the given processing instruction using the target and the data.
public virtual string Processing(IProcessingInstruction processing)
Parameters
processing
IProcessingInstructionThe processing instruction to stringify.
Returns
- string
The formatted processing instruction.
Text(ICharacterData)
Formats the given text.
public virtual string Text(ICharacterData text)
Parameters
text
ICharacterDataThe text to sanitize.
Returns
- string
The formatted text.
XmlNamespaceLocalName(string)
Gets the local name using the XML namespace prefix if required.
public static string XmlNamespaceLocalName(string name)
Parameters
name
stringThe name to be properly represented.
Returns
- string
The string representation.