HtmlAttributesExtensions Class

Extensions for a MarkdownObject to allow accessing HtmlAttributes

public static class HtmlAttributesExtensions

Methods

NameDescription
GetAttributes(IMarkdownObject)Gets or creates the HtmlAttributes stored on a MarkdownObject
SetAttributes(IMarkdownObject, HtmlAttributes)Sets HtmlAttributes to the MarkdownObject
TryGetAttributes(IMarkdownObject)Tries the get HtmlAttributes stored on a MarkdownObject.

GetAttributes(IMarkdownObject)

HtmlAttributesExtensions.cs

Gets or creates the HtmlAttributes stored on a MarkdownObject

public static HtmlAttributes GetAttributes(this IMarkdownObject obj)

Parameters

obj IMarkdownObject
The markdown object.

Returns

HtmlAttributes The attached html attributes

SetAttributes(IMarkdownObject, HtmlAttributes)

HtmlAttributesExtensions.cs
public static void SetAttributes(this IMarkdownObject obj, HtmlAttributes attributes)

Parameters

obj IMarkdownObject
The markdown object.
attributes HtmlAttributes
The attributes to attach.

TryGetAttributes(IMarkdownObject)

HtmlAttributesExtensions.cs

Tries the get HtmlAttributes stored on a MarkdownObject.

public static HtmlAttributes? TryGetAttributes(this IMarkdownObject obj)

Parameters

obj IMarkdownObject
The markdown object.

Returns

HtmlAttributes? The attached html attributes or null if not found