MarkdownDocumentSyntax Class

A Markdown document: its blocks, and the end of the text.

public sealed class MarkdownDocumentSyntax : MarkdownSyntaxNode
Inheritance
MarkdownSyntaxNode MarkdownDocumentSyntax

Properties

NameDescription
BlocksGets the blocks of the document, in the order of the text.
EndOfFileTokenGets the token that ends the document, which holds the trivia after the last block.
LinkReferenceDefinitionsGets the link reference definitions of the document, in the order of the text.

Gets the blocks of the document, in the order of the text.

public ImmutableArray<MarkdownBlockSyntax> Blocks { get; }

Gets the token that ends the document, which holds the trivia after the last block.

public SyntaxToken EndOfFileToken { get; }

Property value

SyntaxToken

LinkReferenceDefinitions

MarkdownDocumentSyntax.cs

Gets the link reference definitions of the document, in the order of the text.

public IEnumerable<MarkdownLinkReferenceDefinitionSyntax> LinkReferenceDefinitions { get; }

Methods

NameDescription
Accept(MarkdownSyntaxVisitor)
Accept<TResult>(MarkdownSyntaxVisitor<TResult>)
FindClosestLine(int)Finds the line of the block that is the closest to a line, as Markdig does for its pragma lines: an editor scrolls its preview to the element whose id is pragma-line-N, where N is the line that this method returns.
GetAbbreviationDefinition(string)Finds the definition of an abbreviation: the last one with the same label, compared as the text writes it.
GetFootnoteDefinition(string)Finds the definition of a footnote: the first one with the same label, compared as CommonMark compares link labels.
GetLinkReferenceDefinition(string)Finds the definition of a link label: the first one with the same label, compared as CommonMark does. In a cell of a grid table, the definitions of the tree of the table are found too.

Accept overloads

Accept(MarkdownSyntaxVisitor)

MarkdownDocumentSyntax.cs
public override void Accept(MarkdownSyntaxVisitor visitor)
Parameters
visitor MarkdownSyntaxVisitor

No documentation is available.

Accept<TResult>(MarkdownSyntaxVisitor<TResult>)

MarkdownDocumentSyntax.cs
public override TResult? Accept<TResult>(MarkdownSyntaxVisitor<TResult> visitor)
Type parameters
TResult
Parameters
visitor MarkdownSyntaxVisitor<TResult>
Returns

TResult?

No documentation is available.

FindClosestLine(int)

MarkdownDocumentSyntax.cs

Finds the line of the block that is the closest to a line, as Markdig does for its pragma lines: an editor scrolls its preview to the element whose id is pragma-line-N, where N is the line that this method returns.

public int FindClosestLine(int line)

Parameters

line int
The zero-based number of a line of the text.

Returns

int The zero-based number of the line where the block starts, or 0 when the document has no block.

GetAbbreviationDefinition(string)

MarkdownDocumentSyntax.cs

Finds the definition of an abbreviation: the last one with the same label, compared as the text writes it.

public MarkdownAbbreviationDefinitionSyntax? GetAbbreviationDefinition(string label)

Parameters

label string

Returns

MarkdownAbbreviationDefinitionSyntax?

Exceptions

ArgumentNullException
label is null.

GetFootnoteDefinition(string)

MarkdownDocumentSyntax.cs

Finds the definition of a footnote: the first one with the same label, compared as CommonMark compares link labels.

public MarkdownFootnoteDefinitionSyntax? GetFootnoteDefinition(string label)

Parameters

label string
The label, with its ^.

Returns

MarkdownFootnoteDefinitionSyntax?

Exceptions

ArgumentNullException
label is null.

Remarks

The content of a cell of a grid table has no footnote: its references are to the footnotes of the tree of the table.

GetLinkReferenceDefinition(string)

MarkdownDocumentSyntax.cs

Finds the definition of a link label: the first one with the same label, compared as CommonMark does. In a cell of a grid table, the definitions of the tree of the table are found too.

public MarkdownLinkReferenceDefinitionSyntax? GetLinkReferenceDefinition(string label)

Parameters

label string

Returns

MarkdownLinkReferenceDefinitionSyntax?

Exceptions

ArgumentNullException
label is null.