Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

MarkdownParseInfo

OfficeIMO.Markdown

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

Result of parsing markdown into both the object model and a syntax tree.

Inheritance

  • object
  • MarkdownParseInfo

Usage

Explore 3 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 2

Accepted by parameters 1

Methods

public MarkdownSyntaxNode? FindDeepestFinalNodeAtLine(int lineNumber) #

Finds the deepest syntax node in the final document tree whose source span contains the given 1-based line number.

Parameters

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

Finds the deepest syntax node in the final document tree whose source span contains the given 1-based line and column.

Parameters

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

Finds the deepest syntax node in the final document tree whose source span fully contains the given span.

Parameters

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

Finds the deepest syntax node in the final document tree whose source span overlaps the given span.

Parameters

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

Finds the deepest syntax 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 syntax 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 syntax node whose source span fully contains the given span.

Parameters

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

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

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required
public object? FindFinalAssociatedObjectAtLine(int lineNumber) #

Finds the nearest associated object in the final syntax tree at the given 1-based line number.

Parameters

lineNumber int required

Returns

object?
public TAssociatedObject? FindFinalAssociatedObjectAtLine<TAssociatedObject>(int lineNumber) #

Finds the nearest associated object of the requested type in the final syntax tree at the given 1-based line number.

Type Parameters

TAssociatedObject

Parameters

lineNumber int required

Returns

TAssociatedObject?
public object? FindFinalAssociatedObjectAtPosition(int lineNumber, int columnNumber) #

Finds the nearest associated object in the final syntax tree at the given 1-based line and column.

Parameters

lineNumber int required
columnNumber int required

Returns

object?
public TAssociatedObject? FindFinalAssociatedObjectAtPosition<TAssociatedObject>(int lineNumber, int columnNumber) #

Finds the nearest associated object of the requested type in the final syntax tree at the given 1-based line and column.

Type Parameters

TAssociatedObject

Parameters

lineNumber int required
columnNumber int required

Returns

TAssociatedObject?
public object? FindFinalAssociatedObjectContainingSpan(MarkdownSourceSpan span) #

Finds the nearest associated object in the final syntax tree whose source span fully contains the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required

Returns

object?
public TAssociatedObject? FindFinalAssociatedObjectContainingSpan<TAssociatedObject>(MarkdownSourceSpan span) #

Finds the nearest associated object of the requested type in the final syntax tree whose source span fully contains the given span.

Type Parameters

TAssociatedObject

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required

Returns

TAssociatedObject?
public object? FindFinalAssociatedObjectOverlappingSpan(MarkdownSourceSpan span) #

Finds the nearest associated object in the final syntax tree whose source span overlaps the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required

Returns

object?
public TAssociatedObject? FindFinalAssociatedObjectOverlappingSpan<TAssociatedObject>(MarkdownSourceSpan span) #

Finds the nearest associated object of the requested type in the final syntax tree whose source span overlaps the given span.

Type Parameters

TAssociatedObject

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required

Returns

TAssociatedObject?
public MarkdownSyntaxNode? FindFinalNodeForAssociatedObject(object associatedObject) #

Finds the first node in the final syntax tree associated with the supplied model object.

Parameters

associatedObject object required
public IReadOnlyList<MarkdownSyntaxNode> FindFinalNodePathAtLine(int lineNumber) #

Finds the syntax node path from the final document root to the deepest node containing the given 1-based line number.

Parameters

lineNumber int required

Returns

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

Finds the syntax node path from the final document root to the deepest node containing the given 1-based line and column.

Parameters

lineNumber int required
columnNumber int required

Returns

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

Finds the syntax node path from the final document root to the deepest node whose source span fully contains the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required

Returns

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

Finds the syntax node path from the final document root to the deepest node whose source span overlaps the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required

Returns

IReadOnlyList<MarkdownSyntaxNode>
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 MarkdownSyntaxNode? FindNearestFinalBlockAtLine(int lineNumber) #

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

Parameters

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

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

Parameters

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

Finds the nearest block-like syntax node in the final document tree whose source span fully contains the given span.

Parameters

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

Finds the nearest block-like syntax node in the final document tree whose source span overlaps the given span.

Parameters

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

Finds the syntax node path from the document root to the deepest node containing the given 1-based line number.

Parameters

lineNumber int required

Returns

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

Finds the syntax node path from the document root to the deepest node containing 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 syntax node path from the document root 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 syntax node path from the document root to the deepest node whose source span overlaps the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required

Returns

IReadOnlyList<MarkdownSyntaxNode>
TryCreateOriginalSourceSlice 6 overloads
public bool TryCreateOriginalSourceSlice(object associatedObject, out MarkdownSourceSlice slice) #

Creates an original-input source slice for the final syntax node associated with the supplied model object.

Parameters

associatedObject object required
slice OfficeIMO.Markdown.MarkdownSourceSlice required

Returns

bool
public bool TryCreateOriginalSourceSlice(object associatedObject, out MarkdownSourceSlice slice, out MarkdownOriginalSourceSliceFailureReason failureReason) #

Creates an original-input source slice for the final syntax node associated with the supplied model object.

Parameters

associatedObject object required
slice OfficeIMO.Markdown.MarkdownSourceSlice required
failureReason OfficeIMO.Markdown.MarkdownOriginalSourceSliceFailureReason required

Returns

bool
public bool TryCreateOriginalSourceSlice(MarkdownSyntaxNode node, out MarkdownSourceSlice slice) #

Creates a source slice over the original reader input when it is safely equivalent to the normalized span text.

Parameters

node OfficeIMO.Markdown.MarkdownSyntaxNode required
slice OfficeIMO.Markdown.MarkdownSourceSlice required

Returns

bool
public bool TryCreateOriginalSourceSlice(MarkdownSyntaxNode node, out MarkdownSourceSlice slice, out MarkdownOriginalSourceSliceFailureReason failureReason) #

Creates a source slice over the original reader input when it is safely equivalent to the normalized span text.

Parameters

node OfficeIMO.Markdown.MarkdownSyntaxNode required
slice OfficeIMO.Markdown.MarkdownSourceSlice required
failureReason OfficeIMO.Markdown.MarkdownOriginalSourceSliceFailureReason required

Returns

bool
public bool TryCreateOriginalSourceSlice(MarkdownSourceSpan span, out MarkdownSourceSlice slice) #

Creates a source slice over the original reader input when it is safely equivalent to the normalized span text.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required
slice OfficeIMO.Markdown.MarkdownSourceSlice required

Returns

bool
public bool TryCreateOriginalSourceSlice(MarkdownSourceSpan span, out MarkdownSourceSlice slice, out MarkdownOriginalSourceSliceFailureReason failureReason) #

Creates a source slice over the original reader input when it is safely equivalent to the normalized span text.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required
slice OfficeIMO.Markdown.MarkdownSourceSlice required
failureReason OfficeIMO.Markdown.MarkdownOriginalSourceSliceFailureReason required

Returns

bool
TryCreateSourceMapping 3 overloads
public bool TryCreateSourceMapping(object associatedObject, out MarkdownSourceMapping mapping) #

Creates a source mapping that always includes the normalized slice and includes the original-input slice when it maps safely.

Parameters

associatedObject object required
mapping OfficeIMO.Markdown.MarkdownSourceMapping required

Returns

bool
public bool TryCreateSourceMapping(MarkdownSyntaxNode node, out MarkdownSourceMapping mapping) #

Creates a source mapping that always includes the normalized slice and includes the original-input slice when it maps safely.

Parameters

node OfficeIMO.Markdown.MarkdownSyntaxNode required
mapping OfficeIMO.Markdown.MarkdownSourceMapping required

Returns

bool
public bool TryCreateSourceMapping(MarkdownSourceSpan span, out MarkdownSourceMapping mapping) #

Creates a source mapping that always includes the normalized slice and includes the original-input slice when it maps safely.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required
mapping OfficeIMO.Markdown.MarkdownSourceMapping required

Returns

bool
TryCreateSourceSlice 3 overloads
public bool TryCreateSourceSlice(object associatedObject, out MarkdownSourceSlice slice) #

Creates a source slice for the final syntax node associated with the supplied model object.

Parameters

associatedObject object required
slice OfficeIMO.Markdown.MarkdownSourceSlice required

Returns

bool
public bool TryCreateSourceSlice(MarkdownSyntaxNode node, out MarkdownSourceSlice slice) #

Creates a source slice over the normalized markdown text that backs source spans.

Parameters

node OfficeIMO.Markdown.MarkdownSyntaxNode required
slice OfficeIMO.Markdown.MarkdownSourceSlice required

Returns

bool
public bool TryCreateSourceSlice(MarkdownSourceSpan span, out MarkdownSourceSlice slice) #

Creates a source slice over the normalized markdown text that backs source spans.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan required
slice OfficeIMO.Markdown.MarkdownSourceSlice required

Returns

bool

Properties

public MarkdownDocument Document { get; } #

The parsed markdown object model.

public MarkdownSyntaxNode SyntaxTree { get; } #

The original syntax tree produced before document transforms were applied. When a transform replaces the document instance, this tree intentionally drops semantic MarkdownSyntaxNode.AssociatedObject bindings to avoid stale object references. Use MarkdownParseInfo.FinalSyntaxTree for syntax-to-model navigation against MarkdownParseInfo.Document.

public MarkdownSyntaxNode FinalSyntaxTree { get; } #

The syntax tree corresponding to the final returned MarkdownParseInfo.Document.

public string SourceMarkdown { get; } #

The normalized markdown source text used to compute syntax source spans.

public string OriginalMarkdown { get; } #

Raw markdown input retained when MarkdownLoadOptions.PreserveTrivia was enabled; otherwise this falls back to MarkdownParseInfo.SourceMarkdown.

public bool PreservesOriginalMarkdown { get; } #

Indicates whether MarkdownParseInfo.OriginalMarkdown contains the exact reader input captured before input normalization and line-ending normalization.

public IReadOnlyList<MarkdownDocumentTransformDiagnostic> TransformDiagnostics { get; } #

Optional document-transform diagnostics captured during parsing.

public IReadOnlyList<MarkdownGeneratedSyntaxDiagnostic> GeneratedSyntaxDiagnostics { get; } #

Diagnostics for final syntax nodes generated from semantic content rather than exact parsed source.

public IReadOnlyList<MarkdownReferenceLinkDefinition> ReferenceLinkDefinitions { get; } #

Effective reference-style link definitions collected during parsing, in source order where spans are available.

public IReadOnlyList<MarkdownAbbreviationDefinition> AbbreviationDefinitions { get; } #

Effective abbreviation definitions collected during parsing, in source order where spans are available.