MarkdownDelimiterExtension Class

An inline syntax that wraps content between runs of a character, such as %%highlight%%. The runs take part in the processing of emphasis, as MarkdownExtensions.Inserted (++) and MarkdownExtensions.Marked (==) do, so the construct nests with emphasis in both directions. The construct is a MarkdownExtensionInlineSyntax whose markers are the runs and whose inlines are the content.

public sealed class MarkdownDelimiterExtension : MarkdownSyntaxExtension

Remarks

A run opens or closes as a run of * does in CommonMark, a run shorter than MarkdownDelimiterExtension.MinimumCount is text, and a match uses as many characters of the runs as it can, up to MarkdownDelimiterExtension.MaximumCount. The character must not be one that an enabled extension of MarkdownExtensions reads, such as ~ with strikethrough: the parser throws an ArgumentException for such options.

Inheritance
MarkdownSyntaxExtension MarkdownDelimiterExtension

Constructors

NameDescription
MarkdownDelimiterExtension(string, char, int, int)Initializes a new instance of the MarkdownDelimiterExtension class.

MarkdownDelimiterExtension(string, char, int, int)

MarkdownDelimiterExtension.cs

Initializes a new instance of the MarkdownDelimiterExtension class.

public MarkdownDelimiterExtension(string name, char character, int minimumCount = 2, int maximumCount = 2)

Parameters

name string
The name of the extension, which the nodes of its constructs have.
character char
The character of the runs: ASCII punctuation that CommonMark does not read, such as %.
minimumCount int
The length of the shortest run that is a delimiter.
maximumCount int
The most characters of each run that one construct uses: minimumCount or more.

Exceptions

ArgumentException
name is empty, or character is not ASCII punctuation, or is one that CommonMark reads.
ArgumentNullException
name is null.
ArgumentOutOfRangeException
minimumCount is not positive, or maximumCount is less than minimumCount.

Properties

NameDescription
CharacterGets the character of the runs.
MaximumCountGets the most characters of each run that one construct uses.
MinimumCountGets the length of the shortest run that is a delimiter.

Gets the character of the runs.

public char Character { get; }

Property value

char

Gets the most characters of each run that one construct uses.

public int MaximumCount { get; }

Property value

int

Gets the length of the shortest run that is a delimiter.

public int MinimumCount { get; }

Property value

int