Class NodePrintExtensions
- Namespace
- Bunit
- Assembly
- Bunit.Web.dll
Helper methods for pretty printing markup from AngleSharp.Dom.INode and AngleSharp.Dom.INodeList.
public static class NodePrintExtensions
- Inheritance
-
NodePrintExtensions
- Inherited Members
Methods
ToDiffMarkup(IMarkupFormattable)
Uses the DiffMarkupFormatter to generate a HTML markup string
from a AngleSharp.IMarkupFormattable markupFormattable
.
The generated HTML markup will NOT include the internal Blazor attributes
added to elements.
public static string ToDiffMarkup(this IMarkupFormattable markupFormattable)
Parameters
markupFormattable
IMarkupFormattable
Returns
ToDiffMarkup(IEnumerable<INode>)
Uses the DiffMarkupFormatter to generate a HTML markup string
from a IEnumerable<T> nodes
.
The generated HTML markup will NOT include the internal Blazor attributes
added to elements.
public static string ToDiffMarkup(this IEnumerable<INode> nodes)
Parameters
nodes
IEnumerable<INode>
Returns
ToHtml(IEnumerable<INode>, TextWriter, IMarkupFormatter)
Writes the serialization of the node guided by the formatter.
public static void ToHtml(this IEnumerable<INode> nodes, TextWriter writer, IMarkupFormatter formatter)
Parameters
nodes
IEnumerable<INode>The nodes to serialize.
writer
TextWriterThe output target of the serialization.
formatter
IMarkupFormatterThe formatter to use.
ToMarkup(IMarkupFormattable)
Uses the AngleSharp.Html.PrettyMarkupFormatter to generate a HTML markup
from a AngleSharp.IMarkupFormattable markupFormattable
.
public static string ToMarkup(this IMarkupFormattable markupFormattable)
Parameters
markupFormattable
IMarkupFormattable
Returns
ToMarkup(IEnumerable<INode>)
Uses the AngleSharp.Html.PrettyMarkupFormatter to generate a HTML markup string
from a IEnumerable<T> nodes
.
public static string ToMarkup(this IEnumerable<INode> nodes)
Parameters
nodes
IEnumerable<INode>
Returns
ToMarkupElementOnly(IElement)
Converts an AngleSharp.Dom.IElement into a HTML markup string, with only its tag and attributes included in the output. All child nodes are skipped.
public static string ToMarkupElementOnly(this IElement element)
Parameters
element
IElement