GetParserState(InlineParser, Func) Method

Definition

Namespace Markdig.Parsers
Assembly Markdig.dll

Gets or creates a parser state instance scoped to the current leaf processing pass.

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TState GetParserState<TState>(InlineParser parser, Func<TState> factory)
    where TState : class

Type parameters

TState
The type of state to get or create.

Parameters

parser
InlineParser

The parser requesting the state.

factory
Func<TState>

A factory used to create a state instance when none exists yet.

Returns

{TState}
The existing or newly created state instance.