LinkReferenceDefinition Class

A link reference definition (Section 4.7 CommonMark specs)

public class LinkReferenceDefinition : LeafBlock

See also

Inheritance
LeafBlock LinkReferenceDefinition

Nested types

NameDescription
LinkReferenceDefinition.CreateLinkInlineDelegateCreates an inline link for the specified LinkReferenceDefinition.

Constructors

NameDescription
LinkReferenceDefinition()Initializes a new instance of the LinkReferenceDefinition class.
LinkReferenceDefinition(string?, string?, string?)Initializes a new instance of the LinkReferenceDefinition class.

LinkReferenceDefinition overloads

LinkReferenceDefinition()

LinkReferenceDefinition.cs

Initializes a new instance of the LinkReferenceDefinition class.

public LinkReferenceDefinition()

LinkReferenceDefinition(string?, string?, string?)

LinkReferenceDefinition.cs

Initializes a new instance of the LinkReferenceDefinition class.

public LinkReferenceDefinition(string? label, string? url, string? title)
Parameters
label string?
The label.
url string?
The URL.
title string?
The title.

Properties

NameDescription
CreateLinkInlineGets or sets the create link inline callback for this instance.
LabelGets or sets the label. Text is normalized according to spec.
LabelWithTriviaNon-normalized Label (includes trivia) Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.
TitleGets or sets the title.
TitleEnclosingCharacterGets or sets the character the LinkReferenceDefinition.Title is enclosed in. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise \0.
TriviaBeforeTitlegets or sets the whitespace before a LinkReferenceDefinition.Title. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.
TriviaBeforeUrlWhitespace before the LinkReferenceDefinition.Url. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.
UnescapedTitleNon-normalized LinkReferenceDefinition.Title. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.
UnescapedUrlNon-normalized LinkReferenceDefinition.Url. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.
UrlGets or sets the URL.
UrlHasPointyBracketsTrue when the LinkReferenceDefinition.Url is enclosed in point brackets in the source document. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise false.

Gets or sets the create link inline callback for this instance.

public LinkReferenceDefinition.CreateLinkInlineDelegate? CreateLinkInline { get; set; }

Property value

LinkReferenceDefinition.CreateLinkInlineDelegate?

Remarks

This callback is called when an inline link is matching this reference definition.

Gets or sets the label. Text is normalized according to spec.

public string? Label { get; set; }

Property value

string?

Non-normalized Label (includes trivia) Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.

public StringSlice LabelWithTrivia { get; set; }

Property value

StringSlice

Gets or sets the title.

public string? Title { get; set; }

Property value

string?

TitleEnclosingCharacter

LinkReferenceDefinition.cs

Gets or sets the character the LinkReferenceDefinition.Title is enclosed in. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise \0.

public char TitleEnclosingCharacter { get; set; }

Property value

char

gets or sets the whitespace before a LinkReferenceDefinition.Title. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.

public StringSlice TriviaBeforeTitle { get; set; }

Property value

StringSlice

Whitespace before the LinkReferenceDefinition.Url. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.

public StringSlice TriviaBeforeUrl { get; set; }

Property value

StringSlice

Non-normalized LinkReferenceDefinition.Title. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.

public StringSlice UnescapedTitle { get; set; }

Property value

StringSlice

Non-normalized LinkReferenceDefinition.Url. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.

public StringSlice UnescapedUrl { get; set; }

Property value

StringSlice

Gets or sets the URL.

public string? Url { get; set; }

Property value

string?

UrlHasPointyBrackets

LinkReferenceDefinition.cs

True when the LinkReferenceDefinition.Url is enclosed in point brackets in the source document. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise false.

public bool UrlHasPointyBrackets { get; set; }

Property value

bool

Methods

NameDescription
TryParse<T>(T, LinkReferenceDefinition?)Tries to the parse the specified text into a definition.
TryParseTrivia<T>(T, LinkReferenceDefinition?, SourceSpan, SourceSpan, SourceSpan, SourceSpan, SourceSpan, SourceSpan, SourceSpan)Tries to the parse the specified text into a definition.

TryParse<T>(T, LinkReferenceDefinition?)

LinkReferenceDefinition.cs

Tries to the parse the specified text into a definition.

public static bool TryParse<T>(ref T text, out LinkReferenceDefinition? block) where T : ICharIterator

Type parameters

T
Type of the text

Parameters

text T
The text.
block LinkReferenceDefinition?
The block.

Returns

bool true if parsing is successful; false otherwise

TryParseTrivia<T>(T, LinkReferenceDefinition?, SourceSpan, SourceSpan, SourceSpan, SourceSpan, SourceSpan, SourceSpan, SourceSpan)

LinkReferenceDefinition.cs

Tries to the parse the specified text into a definition.

public static bool TryParseTrivia<T>(ref T text, out LinkReferenceDefinition? block, out SourceSpan triviaBeforeLabel, out SourceSpan labelWithTrivia, out SourceSpan triviaBeforeUrl, out SourceSpan unescapedUrl, out SourceSpan triviaBeforeTitle, out SourceSpan unescapedTitle, out SourceSpan triviaAfterTitle) where T : ICharIterator

Type parameters

T
Type of the text

Parameters

text T
The text.
block LinkReferenceDefinition?
The block.
triviaBeforeLabel SourceSpan
labelWithTrivia SourceSpan
triviaBeforeUrl SourceSpan
unescapedUrl SourceSpan
triviaBeforeTitle SourceSpan
unescapedTitle SourceSpan
triviaAfterTitle SourceSpan

Returns

bool true if parsing is successful; false otherwise

Fields

NameDescription
LabelSpanThe label span
TitleSpanThe title span
UrlSpanThe URL span

LabelSpan

The label span

public SourceSpan LabelSpan

TitleSpan

The title span

public SourceSpan TitleSpan

UrlSpan

The URL span

public SourceSpan UrlSpan