API Reference
MarkdownBlockParserContext
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
- Method MarkdownBlockParser.BeginInvoke
- Method MarkdownBlockParser.Invoke
Methods
public MarkdownSourceSpan CreateLineSpan(Int32 relativeStartLine, Int32 lineCount) #MarkdownSourceSpanCreates a source span for a line range relative to the current parser position.
Parameters
- relativeStartLine System.Int32
- Zero-based line offset from the current parser position.
- lineCount System.Int32
- 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) #MarkdownSourceSpanCreates a column-aware source span for a range relative to the current parser position.
Parameters
- relativeStartLine System.Int32
- Zero-based start-line offset from the current parser position.
- startColumn System.Int32
- One-based start column on the resolved start line.
- relativeEndLine System.Int32
- Zero-based end-line offset from the current parser position.
- endColumn System.Int32
- 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) #IReadOnlyList<String>Returns a slice of source lines relative to the current line.
Parameters
- relativeStart System.Int32
- lineCount System.Int32
public InlineSequence ParseInlineText(Int32 relativeLine, Int32 startColumn, Int32 length) #InlineSequenceParses an inline slice from a source line while preserving source spans for inline syntax.
Parameters
- relativeLine System.Int32
- Zero-based line offset from the current parser position.
- startColumn System.Int32
- One-based start column for the inline slice.
- length System.Int32
- 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) #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
- lineCount System.Int32
public Boolean TryCreateSourceSlice(MarkdownSourceSpan sourceSpan, out MarkdownSourceSlice slice) #BooleanCreates a normalized source slice for a token or field source span captured during parsing.
Parameters
- sourceSpan OfficeIMO.Markdown.MarkdownSourceSpan
- slice OfficeIMO.Markdown.MarkdownSourceSlice@
public Boolean TryCreateSourceSlice(Int32 relativeStartLine, Int32 lineCount, out MarkdownSourceSlice slice) #BooleanCreates a normalized source slice for a line range relative to the current parser position.
Parameters
- relativeStartLine System.Int32
- Zero-based line offset from the current parser position.
- lineCount System.Int32
- Number of source lines covered by the slice.
- slice OfficeIMO.Markdown.MarkdownSourceSlice@
- 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) #BooleanReturns a source line relative to the current line.
Parameters
- relativeOffset System.Int32
- line System.String@
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
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.