Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

MarkdownBlockParserContext

OfficeIMO.Markdown

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

Context passed to delegate-based custom block parser extensions.

Inheritance

  • object
  • MarkdownBlockParserContext

Usage

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

Accepted by parameters 2

Methods

public MarkdownSourceSpan CreateLineSpan(int relativeStartLine, int lineCount) #

Creates a source span for a line range relative to the current parser position.

Parameters

relativeStartLine int required
Zero-based line offset from the current parser position.
lineCount int required
Number of source lines covered by the span.

Returns

MarkdownSourceSpan A source span mapped to the normalized markdown input when source mapping is available.
public MarkdownSourceSpan CreateSourceSpan(int relativeStartLine, int startColumn, int relativeEndLine, int endColumn) #

Creates a column-aware source span for a range relative to the current parser position.

Parameters

relativeStartLine int required
Zero-based start-line offset from the current parser position.
startColumn int required
One-based start column on the resolved start line.
relativeEndLine int required
Zero-based end-line offset from the current parser position.
endColumn int required
One-based end column on the resolved end line.

Returns

MarkdownSourceSpan A source span mapped to the normalized markdown input when source mapping is available.
public IReadOnlyList<string> GetLines(int relativeStart, int lineCount) #

Returns a slice of source lines relative to the current line.

Parameters

relativeStart int required
lineCount int required

Returns

IReadOnlyList<string>
public InlineSequence ParseInlineText(int relativeLine, int startColumn, int length) #

Parses an inline slice from a source line while preserving source spans for inline syntax.

Parameters

relativeLine int required
Zero-based line offset from the current parser position.
startColumn int required
One-based start column for the inline slice.
length int required
Number of characters to parse from the source line.

Returns

InlineSequence Parsed inline sequence with source-map-backed inline nodes when available.
public IReadOnlyList<IMarkdownBlock> ParseNestedBlocks(int relativeStartLine, int lineCount) #

Parses a nested markdown block range relative to the current line using the same reader options, while preserving source spans for the nested content.

Parameters

relativeStartLine int required
lineCount int required

Returns

IReadOnlyList<IMarkdownBlock>
TryCreateSourceSlice 2 overloads
public bool TryCreateSourceSlice(MarkdownSourceSpan sourceSpan, out MarkdownSourceSlice slice) #

Creates a normalized source slice for a token or field source span captured during parsing.

Parameters

sourceSpan OfficeIMO.Markdown.MarkdownSourceSpan required
slice OfficeIMO.Markdown.MarkdownSourceSlice required

Returns

bool
public bool TryCreateSourceSlice(int relativeStartLine, int lineCount, out MarkdownSourceSlice slice) #

Creates a normalized source slice for a line range relative to the current parser position.

Parameters

relativeStartLine int required
Zero-based line offset from the current parser position.
lineCount int required
Number of source lines covered by the slice.
slice OfficeIMO.Markdown.MarkdownSourceSlice required
Materialized normalized source slice when the method returns true.

Returns

bool true when the normalized source text is available and the range can be materialized.
public bool TryGetLine(int relativeOffset, out string line) #

Returns a source line relative to the current line.

Parameters

relativeOffset int required
line string required

Returns

bool

Properties

public IReadOnlyList<string> Lines { get; } #

Full document lines being parsed.

public int LineIndex { get; } #

Zero-based current line index.

public int LineNumber { get; } #

One-based current line number.

public string CurrentLine { get; } #

Current source line, or an empty string when positioned outside the input.

public MarkdownLoadOptions Options { get; } #

Reader options active for the current parse.

public MarkdownDocument Document { get; } #

Markdown document being built.

public MarkdownReaderState State { get; } #

Mutable reader state shared across parsers.