MarkdownSyntaxNode Class

The base of every node of a Markdown syntax tree: a block, an inline, or a part of a table.

public abstract class MarkdownSyntaxNode : SyntaxNode

Remarks

The tokens of a node are the text of its construct: the marker of a block quote, the backticks of a code span, the brackets and the destination of a link. The properties of the derived types read them, and give the values they stand for: the level of a heading, the destination of a link without its escapes.

Inheritance
SyntaxNode MarkdownSyntaxNode

Properties

NameDescription
ParentGets the parent of the node, or null for the document.

Gets the parent of the node, or null for the document.

public MarkdownSyntaxNode? Parent { get; }

Property value

MarkdownSyntaxNode?

Methods

NameDescription
Accept(MarkdownSyntaxVisitor)Calls the method of visitor that matches this node.
Accept<TResult>(MarkdownSyntaxVisitor<TResult>)Calls the method of visitor that matches this node.
GetPlainText()Gets the text of the node without its markup, as a reader sees it.
Kind()Gets the kind of the node.

Accept overloads

Accept(MarkdownSyntaxVisitor)

Calls the method of visitor that matches this node.

public abstract void Accept(MarkdownSyntaxVisitor visitor)
Parameters
visitor MarkdownSyntaxVisitor
Exceptions
ArgumentNullException
visitor is null.

Accept<TResult>(MarkdownSyntaxVisitor<TResult>)

Calls the method of visitor that matches this node.

public abstract TResult? Accept<TResult>(MarkdownSyntaxVisitor<TResult> visitor)
Type parameters
TResult
Parameters
visitor MarkdownSyntaxVisitor<TResult>
Returns

TResult?

Exceptions
ArgumentNullException
visitor is null.

GetPlainText()

MarkdownSyntaxNode.cs

Gets the text of the node without its markup, as a reader sees it.

public virtual string GetPlainText()

Returns

string

Remarks

The escapes and the entities are decoded, a code span is its code, a link is its text, and raw HTML is left out. The blocks of a container are separated by a line break.

Gets the kind of the node.

public SyntaxKind Kind()

Returns

SyntaxKind