MarkdownLinkSyntax Class
A link ([text](destination), [text][label]...) or an image ().
public sealed class MarkdownLinkSyntax : MarkdownInlineSyntax- Inheritance
MarkdownInlineSyntaxMarkdownLinkSyntax
Properties
| Name | Description |
|---|---|
| Definition | Gets the definition that a reference link refers to, or null. |
| Destination | Gets the destination, without its angle brackets, escapes and entities: the one of the definition for a reference link. |
| DestinationToken | Gets the destination of an inline link, or the default token. |
| Heading | Gets the heading that a reference link without definition links to with MarkdownExtensions.AutoIdentifiers, or null. |
| IsImage | Gets a value indicating whether this is an image: its text is the description of the image. |
| Label | Gets the label that refers to a link reference definition, or null for an inline link. |
| LinkKind | Gets how the link gives its destination. |
| Text | Gets the inlines of the text of the link, between its brackets. |
| Title | Gets the title, without its quotes, escapes and entities, or null when there is none. |
Definition
MarkdownLinkSyntax.csGets the definition that a reference link refers to, or null.
public MarkdownLinkReferenceDefinitionSyntax? Definition { get; }Property value
Destination
MarkdownLinkSyntax.csGets the destination, without its angle brackets, escapes and entities: the one of the definition for a reference link.
public string Destination { get; }Property value
Remarks
A reference link to a MarkdownLinkSyntax.Heading has # and the identifier of the heading as destination. It is empty when a reference link has no definition, which an edit can cause.
DestinationToken
MarkdownLinkSyntax.csGets the destination of an inline link, or the default token.
public SyntaxToken DestinationToken { get; }Property value
Heading
MarkdownLinkSyntax.csGets the heading that a reference link without definition links to with MarkdownExtensions.AutoIdentifiers, or null.
public MarkdownHeadingSyntax? Heading { get; }Property value
IsImage
MarkdownLinkSyntax.csLinkKind
MarkdownLinkSyntax.csGets the inlines of the text of the link, between its brackets.
public IEnumerable<SyntaxNodeOrToken> Text { get; }Property value
Methods
| Name | Description |
|---|---|
| Accept(MarkdownSyntaxVisitor) | |
| Accept<TResult>(MarkdownSyntaxVisitor<TResult>) | |
| WithDestination(string) | Returns this inline link with the destination destination, or itself when it has this destination. |
| WithTitle(string?) | Returns this inline link with the title title, or itself when it has this title. |
Accept overloads
Accept(MarkdownSyntaxVisitor)
MarkdownLinkSyntax.cspublic override void Accept(MarkdownSyntaxVisitor visitor)Parameters
visitorMarkdownSyntaxVisitor
No documentation is available.
Accept<TResult>(MarkdownSyntaxVisitor<TResult>)
MarkdownLinkSyntax.cspublic override TResult? Accept<TResult>(MarkdownSyntaxVisitor<TResult> visitor)No documentation is available.
WithDestination(string)
MarkdownLinkSyntax.csReturns this inline link with the destination destination, or itself when it has this destination.
public MarkdownLinkSyntax WithDestination(string destination)Parameters
destinationstring- The destination, which is escaped: it is the
MarkdownLinkSyntax.Destinationof the link.
Returns
Exceptions
ArgumentNullExceptiondestinationisnull.InvalidOperationException- The link is a reference link.
Remarks
The link is in no tree: replace this one with it, with SyntaxNodeExtensions.ReplaceNode. The destination of a reference link is the one of its definition: change the definition with MarkdownLinkReferenceDefinitionSyntax.WithDestination.
WithTitle(string?)
MarkdownLinkSyntax.csReturns this inline link with the title title, or itself when it has this title.
public MarkdownLinkSyntax WithTitle(string? title)Parameters
titlestring?- The title, which is escaped: it is the
MarkdownLinkSyntax.Titleof the link.nullremoves the title.
Returns
Exceptions
InvalidOperationException- The link is a reference link.
Remarks
The link is in no tree: replace this one with it, with SyntaxNodeExtensions.ReplaceNode. The title of a reference link is the one of its definition: change the definition with MarkdownLinkReferenceDefinitionSyntax.WithTitle.