MarkdownBlockParserContext
OfficeIMO.Markdown
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
- Method MarkdownBlockParser.BeginInvoke
- Method MarkdownBlockParser.Invoke
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
- Zero-based line offset from the current parser position.
- lineCount int
- 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
- Zero-based start-line offset from the current parser position.
- startColumn int
- One-based start column on the resolved start line.
- relativeEndLine int
- Zero-based end-line offset from the current parser position.
- endColumn int
- 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
- lineCount int
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
- Zero-based line offset from the current parser position.
- startColumn int
- One-based start column for the inline slice.
- length int
- Number of characters to parse from the source line.
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
- lineCount int
Returns
IReadOnlyList<IMarkdownBlock>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
- slice OfficeIMO.Markdown.MarkdownSourceSlice
Returns
boolpublic 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
- Zero-based line offset from the current parser position.
- lineCount int
- Number of source lines covered by the slice.
- slice OfficeIMO.Markdown.MarkdownSourceSlice
- 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
- line string
Returns
boolInherited Methods
Properties
public IReadOnlyList<string> Lines { get; } #Full document lines being parsed.
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.