Table of Contents

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

string

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

string

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 TextWriter

The output target of the serialization.

formatter IMarkupFormatter

The 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

string

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

string

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

Returns

string
Progress Telerik

Premium sponsor: Progress Telerik.

Packt

Editorial support provided by Packt.

.NET Foundation

Supported by the .NET Foundation.