GenericAttributesParser Class

An inline parser used to parse a HTML attributes that can be attached to the previous Inline or current Block.

public class GenericAttributesParser : InlineParser

See also

Inheritance
InlineParser GenericAttributesParser

Constructors

NameDescription
GenericAttributesParser()Initializes a new instance of the GenericAttributesParser class.

GenericAttributesParser()

GenericAttributesParser.cs

Initializes a new instance of the GenericAttributesParser class.

public GenericAttributesParser()

Properties

NameDescription
AttributeFilterGets or sets the predicate that decides whether an attribute parsed from the Markdown (other than the id and the classes) is kept. The default value is GenericAttributesExtension.IsSafeAttributeName.

Gets or sets the predicate that decides whether an attribute parsed from the Markdown (other than the id and the classes) is kept. The default value is GenericAttributesExtension.IsSafeAttributeName.

public Func<string, bool> AttributeFilter { get; set; }

Property value

Func<string, bool>

Methods

NameDescription
Match(InlineProcessor, StringSlice)Attempts to match the parser at the current position.
TryParse(StringSlice, HtmlAttributes?)Tries to extra from the current position of a slice an HTML attributes {...}

Match(InlineProcessor, StringSlice)

GenericAttributesParser.cs

Attempts to match the parser at the current position.

public override bool Match(InlineProcessor processor, ref StringSlice slice)

Parameters

processor InlineProcessor
slice StringSlice

Returns

bool

TryParse(StringSlice, HtmlAttributes?)

GenericAttributesParser.cs

Tries to extra from the current position of a slice an HTML attributes {...}

public static bool TryParse(ref StringSlice slice, out HtmlAttributes? attributes)

Parameters

slice StringSlice
The slice to parse.
attributes HtmlAttributes?
The output attributes or null if not found or invalid

Returns

bool true if parsing the HTML attributes was successful