Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

MarkdownSyntaxNode

OfficeIMO.Markdown

Namespace
OfficeIMO.Markdown
Assembly
OfficeIMO.Markdown
Source revision
0eef6a5756b9 with working tree changes
Modifiers
sealed

A lightweight syntax-tree node built from the parsed markdown document.

Inheritance

  • object
  • MarkdownSyntaxNode

Usage

Explore 121 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 92

Accepted by parameters 29

Constructors

public MarkdownSyntaxNode(MarkdownSyntaxKind kind, MarkdownSourceSpan? sourceSpan = null, string? literal = null, IReadOnlyList<MarkdownSyntaxNode>? children = null, object? associatedObject = null, string? customKind = null, MarkdownAttributeSet? attributes = null, bool isGenerated = false) #

Create a syntax node.

Parameters

kind OfficeIMO.Markdown.MarkdownSyntaxKind required
sourceSpan OfficeIMO.Markdown.MarkdownSourceSpan? = null optional
literal string? = null optional
children System.Collections.Generic.IReadOnlyList<OfficeIMO.Markdown.MarkdownSyntaxNode>? = null optional
associatedObject object? = null optional
customKind string? = null optional
attributes OfficeIMO.Markdown.MarkdownAttributeSet? = null optional
isGenerated bool = false optional

Methods

public IEnumerable<MarkdownSyntaxNode> Ancestors() #

Returns ancestor nodes from the immediate parent up to the root.

Returns

IEnumerable<MarkdownSyntaxNode>
public IEnumerable<MarkdownSyntaxNode> AncestorsAndSelf() #

Returns this node followed by its ancestors up to the root.

Returns

IEnumerable<MarkdownSyntaxNode>
public IEnumerable<MarkdownSyntaxNode> Descendants() #

Returns all descendant nodes in depth-first order, excluding this node.

Returns

IEnumerable<MarkdownSyntaxNode>
public IEnumerable<MarkdownSyntaxNode> DescendantsAndSelf() #

Returns this node and all descendant nodes in depth-first order.

Returns

IEnumerable<MarkdownSyntaxNode>
public MarkdownSyntaxNode? FindDeepestNodeAtLine(int lineNumber) #

Finds the deepest node whose source span contains the given 1-based line number.

Parameters

lineNumber int required
public MarkdownSyntaxNode? FindDeepestNodeAtPosition(int lineNumber, int columnNumber) #

Finds the deepest node whose source span contains the given 1-based line and column.

Parameters

lineNumber int required
columnNumber int required
public MarkdownSyntaxNode? FindDeepestNodeContainingSpan(MarkdownSourceSpan span) #

Finds the deepest node whose source span fully contains the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required
public MarkdownSyntaxNode? FindDeepestNodeOverlappingSpan(MarkdownSourceSpan span) #

Finds the deepest node whose source span overlaps the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required
public MarkdownSyntaxNode? FindNearestBlockAtLine(int lineNumber) #

Finds the nearest block-like syntax node whose source span contains the given 1-based line number.

Parameters

lineNumber int required
public MarkdownSyntaxNode? FindNearestBlockAtPosition(int lineNumber, int columnNumber) #

Finds the nearest block-like syntax node whose source span contains the given 1-based line and column.

Parameters

lineNumber int required
columnNumber int required
public MarkdownSyntaxNode? FindNearestBlockContainingSpan(MarkdownSourceSpan span) #

Finds the nearest block-like syntax node whose source span fully contains the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required
public MarkdownSyntaxNode? FindNearestBlockOverlappingSpan(MarkdownSourceSpan span) #

Finds the nearest block-like syntax node whose source span overlaps the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathAtLine(int lineNumber) #

Finds the node path from this node to the deepest node whose source span contains the given 1-based line number.

Parameters

lineNumber int required

Returns

IReadOnlyList<MarkdownSyntaxNode>
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathAtPosition(int lineNumber, int columnNumber) #

Finds the node path from this node to the deepest node whose source span contains the given 1-based line and column.

Parameters

lineNumber int required
columnNumber int required

Returns

IReadOnlyList<MarkdownSyntaxNode>
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathContainingSpan(MarkdownSourceSpan span) #

Finds the node path from this node to the deepest node whose source span fully contains the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required

Returns

IReadOnlyList<MarkdownSyntaxNode>
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathOverlappingSpan(MarkdownSourceSpan span) #

Finds the node path from this node to the deepest node whose source span overlaps the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required

Returns

IReadOnlyList<MarkdownSyntaxNode>

Properties

public MarkdownSyntaxKind Kind { get; } #

Node kind.

public MarkdownSourceSpan? SourceSpan { get; } #

Optional source span from the original markdown.

public string? Literal { get; } #

Optional literal payload for leaf-like nodes.

public string? CustomKind { get; } #

Optional custom extension kind for nodes emitted by syntax-aware extensions.

public object? AssociatedObject { get; } #

Optional originating model object (document/block/inline) for AST-aware consumers.

public MarkdownAttributeSet Attributes { get; } #

Generic Markdown attributes associated with this syntax node.

public bool IsGenerated { get; } #

Gets a value indicating whether this node was generated while rebuilding syntax from the semantic AST rather than directly parsed from matching source text.

public MarkdownSyntaxNode? Parent { get; private set; } #

Parent syntax node when this node belongs to a larger syntax tree.

public IReadOnlyList<MarkdownSyntaxNode> Children { get; } #

Child syntax nodes.

public bool IsBlockLike { get; } #

Whether this node behaves like a block/container boundary for navigation.

public int IndexInParent { get; } #

Zero-based child index within MarkdownSyntaxNode.Parent when available.

public MarkdownSyntaxNode? PreviousSibling { get; } #

Nearest previous sibling node when present.

public MarkdownSyntaxNode? NextSibling { get; } #

Nearest next sibling node when present.

public MarkdownSyntaxNode Root { get; } #

Document root for this node.