API Reference

Class

MarkdownBlockParserContext

Namespace OfficeIMO.Markdown
Assembly OfficeIMO.Markdown
Modifiers sealed

Context passed to delegate-based custom block parser extensions.

Inheritance

  • Object
  • MarkdownBlockParserContext

Usage

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

Accepted by parameters

Methods

public MarkdownSourceSpan CreateLineSpan(Int32 relativeStartLine, Int32 lineCount) #
Returns: MarkdownSourceSpan

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

Parameters

relativeStartLine System.Int32 requiredposition: 0
Zero-based line offset from the current parser position.
lineCount System.Int32 requiredposition: 1
Number of source lines covered by the span.

Returns

A source span mapped to the normalized markdown input when source mapping is available.

public MarkdownSourceSpan CreateSourceSpan(Int32 relativeStartLine, Int32 startColumn, Int32 relativeEndLine, Int32 endColumn) #
Returns: MarkdownSourceSpan

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

Parameters

relativeStartLine System.Int32 requiredposition: 0
Zero-based start-line offset from the current parser position.
startColumn System.Int32 requiredposition: 1
One-based start column on the resolved start line.
relativeEndLine System.Int32 requiredposition: 2
Zero-based end-line offset from the current parser position.
endColumn System.Int32 requiredposition: 3
One-based end column on the resolved end line.

Returns

A source span mapped to the normalized markdown input when source mapping is available.

public IReadOnlyList<String> GetLines(Int32 relativeStart, Int32 lineCount) #
Returns: IReadOnlyList<String>

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

Parameters

relativeStart System.Int32 requiredposition: 0
lineCount System.Int32 requiredposition: 1
public InlineSequence ParseInlineText(Int32 relativeLine, Int32 startColumn, Int32 length) #
Returns: InlineSequence

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

Parameters

relativeLine System.Int32 requiredposition: 0
Zero-based line offset from the current parser position.
startColumn System.Int32 requiredposition: 1
One-based start column for the inline slice.
length System.Int32 requiredposition: 2
Number of characters to parse from the source line.

Returns

Parsed inline sequence with source-map-backed inline nodes when available.

public IReadOnlyList<IMarkdownBlock> ParseNestedBlocks(Int32 relativeStartLine, Int32 lineCount) #
Returns: IReadOnlyList<IMarkdownBlock>

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 System.Int32 requiredposition: 0
lineCount System.Int32 requiredposition: 1
TryCreateSourceSlice 2 overloads
public Boolean TryCreateSourceSlice(MarkdownSourceSpan sourceSpan, out MarkdownSourceSlice slice) #
Returns: Boolean

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

Parameters

sourceSpan OfficeIMO.Markdown.MarkdownSourceSpan requiredposition: 0
slice OfficeIMO.Markdown.MarkdownSourceSlice@ requiredposition: 1
public Boolean TryCreateSourceSlice(Int32 relativeStartLine, Int32 lineCount, out MarkdownSourceSlice slice) #
Returns: Boolean

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

Parameters

relativeStartLine System.Int32 requiredposition: 0
Zero-based line offset from the current parser position.
lineCount System.Int32 requiredposition: 1
Number of source lines covered by the slice.
slice OfficeIMO.Markdown.MarkdownSourceSlice@ requiredposition: 2
Materialized normalized source slice when the method returns true.

Returns

true when the normalized source text is available and the range can be materialized.

public Boolean TryGetLine(Int32 relativeOffset, out String line) #
Returns: Boolean

Returns a source line relative to the current line.

Parameters

relativeOffset System.Int32 requiredposition: 0
line System.String@ requiredposition: 1

Properties

public IReadOnlyList<String> Lines { get; } #

Full document lines being parsed.

public Int32 LineIndex { get; } #

Zero-based current line index.

public Int32 LineNumber { get; } #

One-based current line number.

public String CurrentLine { get; } #

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

public MarkdownReaderOptions Options { get; } #

Reader options active for the current parse.

public MarkdownDoc Document { get; } #

Markdown document being built.

public MarkdownReaderState State { get; } #

Mutable reader state shared across parsers.