LinkReferenceDefinition Class
A link reference definition (Section 4.7 CommonMark specs)
public class LinkReferenceDefinition : LeafBlockSee also
- Inheritance
LeafBlockLinkReferenceDefinition
Nested types
| Name | Description |
|---|---|
| LinkReferenceDefinition.CreateLinkInlineDelegate | Creates an inline link for the specified LinkReferenceDefinition. |
Constructors
| Name | Description |
|---|---|
| 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.csInitializes a new instance of the LinkReferenceDefinition class.
public LinkReferenceDefinition()LinkReferenceDefinition(string?, string?, string?)
LinkReferenceDefinition.csProperties
| Name | Description |
|---|---|
| CreateLinkInline | Gets or sets the create link inline callback for this instance. |
| Label | Gets or sets the label. Text is normalized according to spec. |
| LabelWithTrivia | Non-normalized Label (includes trivia) Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty. |
| Title | Gets or sets the title. |
| TitleEnclosingCharacter | Gets or sets the character the LinkReferenceDefinition.Title is enclosed in. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise \0. |
| TriviaBeforeTitle | gets or sets the whitespace before a LinkReferenceDefinition.Title. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty. |
| TriviaBeforeUrl | Whitespace before the LinkReferenceDefinition.Url. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty. |
| UnescapedTitle | Non-normalized LinkReferenceDefinition.Title. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty. |
| UnescapedUrl | Non-normalized LinkReferenceDefinition.Url. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty. |
| Url | Gets or sets the URL. |
| UrlHasPointyBrackets | True when the LinkReferenceDefinition.Url is enclosed in point brackets in the source document. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise false. |
CreateLinkInline
LinkReferenceDefinition.csGets 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.
LabelWithTrivia
LinkReferenceDefinition.csNon-normalized Label (includes trivia) Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.
public StringSlice LabelWithTrivia { get; set; }Property value
TitleEnclosingCharacter
LinkReferenceDefinition.csGets 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
TriviaBeforeTitle
LinkReferenceDefinition.csgets 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
TriviaBeforeUrl
LinkReferenceDefinition.csWhitespace before the LinkReferenceDefinition.Url. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.
public StringSlice TriviaBeforeUrl { get; set; }Property value
UnescapedTitle
LinkReferenceDefinition.csNon-normalized LinkReferenceDefinition.Title. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.
public StringSlice UnescapedTitle { get; set; }Property value
UnescapedUrl
LinkReferenceDefinition.csNon-normalized LinkReferenceDefinition.Url. Trivia: only parsed when MarkdownPipeline.TrackTrivia is enabled, otherwise StringSlice.Empty.
public StringSlice UnescapedUrl { get; set; }Property value
UrlHasPointyBrackets
LinkReferenceDefinition.csTrue 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
Methods
| Name | Description |
|---|---|
| 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.csTries to the parse the specified text into a definition.
public static bool TryParse<T>(ref T text, out LinkReferenceDefinition? block) where T : ICharIteratorType parameters
T- Type of the text
Parameters
textT- The text.
blockLinkReferenceDefinition?- The block.
Returns
bool true if parsing is successful; false otherwise
TryParseTrivia<T>(T, LinkReferenceDefinition?, SourceSpan, SourceSpan, SourceSpan, SourceSpan, SourceSpan, SourceSpan, SourceSpan)
LinkReferenceDefinition.csTries 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 : ICharIteratorType parameters
T- Type of the text
Parameters
textT- The text.
blockLinkReferenceDefinition?- The block.
triviaBeforeLabelSourceSpanlabelWithTriviaSourceSpantriviaBeforeUrlSourceSpanunescapedUrlSourceSpantriviaBeforeTitleSourceSpanunescapedTitleSourceSpantriviaAfterTitleSourceSpan
Returns
bool true if parsing is successful; false otherwise
Fields
| Name | Description |
|---|---|
| LabelSpan | The label span |
| TitleSpan | The title span |
| UrlSpan | The URL span |
LabelSpan
The label span
public SourceSpan LabelSpanTitleSpan
The title span
public SourceSpan TitleSpanUrlSpan
The URL span
public SourceSpan UrlSpan