API Reference
MarkdownSyntaxNode
A lightweight syntax-tree node built from the parsed markdown document.
Inheritance
- Object
- MarkdownSyntaxNode
Constructors
public MarkdownSyntaxNode(MarkdownSyntaxKind kind, Nullable<MarkdownSourceSpan> sourceSpan = null, String literal = null, IReadOnlyList<MarkdownSyntaxNode> children = null, Object associatedObject = null, String customKind = null) #Create a syntax node.
Parameters
- kind OfficeIMO.Markdown.MarkdownSyntaxKind
- sourceSpan System.Nullable{OfficeIMO.Markdown.MarkdownSourceSpan} = null
- literal System.String = null
- children System.Collections.Generic.IReadOnlyList{OfficeIMO.Markdown.MarkdownSyntaxNode} = null
- associatedObject System.Object = null
- customKind System.String = null
Methods
public IEnumerable<MarkdownSyntaxNode> Ancestors() #IEnumerable<MarkdownSyntaxNode>Returns ancestor nodes from the immediate parent up to the root.
public IEnumerable<MarkdownSyntaxNode> AncestorsAndSelf() #IEnumerable<MarkdownSyntaxNode>Returns this node followed by its ancestors up to the root.
public IEnumerable<MarkdownSyntaxNode> Descendants() #IEnumerable<MarkdownSyntaxNode>Returns all descendant nodes in depth-first order, excluding this node.
public IEnumerable<MarkdownSyntaxNode> DescendantsAndSelf() #IEnumerable<MarkdownSyntaxNode>Returns this node and all descendant nodes in depth-first order.
public MarkdownSyntaxNode FindDeepestNodeAtLine(Int32 lineNumber) #MarkdownSyntaxNodeFinds the deepest node whose source span contains the given 1-based line number.
Parameters
- lineNumber System.Int32
public MarkdownSyntaxNode FindDeepestNodeAtPosition(Int32 lineNumber, Int32 columnNumber) #MarkdownSyntaxNodeFinds the deepest node whose source span contains the given 1-based line and column.
Parameters
- lineNumber System.Int32
- columnNumber System.Int32
public MarkdownSyntaxNode FindDeepestNodeContainingSpan(MarkdownSourceSpan span) #MarkdownSyntaxNodeFinds the deepest node whose source span fully contains the given span.
Parameters
- span OfficeIMO.Markdown.MarkdownSourceSpan
public MarkdownSyntaxNode FindDeepestNodeOverlappingSpan(MarkdownSourceSpan span) #MarkdownSyntaxNodeFinds the deepest node whose source span overlaps the given span.
Parameters
- span OfficeIMO.Markdown.MarkdownSourceSpan
public MarkdownSyntaxNode FindNearestBlockAtLine(Int32 lineNumber) #MarkdownSyntaxNodeFinds the nearest block-like syntax node whose source span contains the given 1-based line number.
Parameters
- lineNumber System.Int32
public MarkdownSyntaxNode FindNearestBlockAtPosition(Int32 lineNumber, Int32 columnNumber) #MarkdownSyntaxNodeFinds the nearest block-like syntax node whose source span contains the given 1-based line and column.
Parameters
- lineNumber System.Int32
- columnNumber System.Int32
public MarkdownSyntaxNode FindNearestBlockContainingSpan(MarkdownSourceSpan span) #MarkdownSyntaxNodeFinds the nearest block-like syntax node whose source span fully contains the given span.
Parameters
- span OfficeIMO.Markdown.MarkdownSourceSpan
public MarkdownSyntaxNode FindNearestBlockOverlappingSpan(MarkdownSourceSpan span) #MarkdownSyntaxNodeFinds the nearest block-like syntax node whose source span overlaps the given span.
Parameters
- span OfficeIMO.Markdown.MarkdownSourceSpan
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathAtLine(Int32 lineNumber) #IReadOnlyList<MarkdownSyntaxNode>Finds the node path from this node to the deepest node whose source span contains the given 1-based line number.
Parameters
- lineNumber System.Int32
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathAtPosition(Int32 lineNumber, Int32 columnNumber) #IReadOnlyList<MarkdownSyntaxNode>Finds the node path from this node to the deepest node whose source span contains the given 1-based line and column.
Parameters
- lineNumber System.Int32
- columnNumber System.Int32
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathContainingSpan(MarkdownSourceSpan span) #IReadOnlyList<MarkdownSyntaxNode>Finds the node path from this node to the deepest node whose source span fully contains the given span.
Parameters
- span OfficeIMO.Markdown.MarkdownSourceSpan
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathOverlappingSpan(MarkdownSourceSpan span) #IReadOnlyList<MarkdownSyntaxNode>Finds the node path from this node to the deepest node whose source span overlaps the given span.
Parameters
- span OfficeIMO.Markdown.MarkdownSourceSpan
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public MarkdownSyntaxKind Kind { get; } #Node kind.
public Nullable<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 MarkdownSyntaxNode Parent { get; set; } #Parent syntax node when this node belongs to a larger syntax tree.
public IReadOnlyList<MarkdownSyntaxNode> Children { get; } #Child syntax nodes.
public Int32 IndexInParent { get; } #Zero-based child index within 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.