BlockParser Class
Base class for a parser of a Block
public abstract class BlockParser : ParserBase<BlockProcessor>, IBlockParser<BlockProcessor>, IMarkdownParser<BlockProcessor>See also
- Inheritance
ParserBase<BlockProcessor>BlockParser- Implements
Constructors
| Name | Description |
|---|---|
| BlockParser() |
BlockParser()
protected BlockParser()No documentation is available.
Methods
| Name | Description |
|---|---|
| CanInterrupt(BlockProcessor, Block) | Determines whether this instance can interrupt the specified block being processed. |
| Close(BlockProcessor, Block) | Called when a block matched by this parser is being closed (to allow final computation on the block). |
| HasOpeningCharacter(char) | Determines whether the specified char is an opening character. |
| TryContinue(BlockProcessor, Block) | Tries to continue matching a block already opened. |
| TryOpen(BlockProcessor) | Tries to match a block opening. |
CanInterrupt(BlockProcessor, Block)
BlockParser.csDetermines whether this instance can interrupt the specified block being processed.
public virtual bool CanInterrupt(BlockProcessor processor, Block block)Parameters
processorBlockProcessor- The parser processor.
blockBlock- The block being processed.
Returns
bool true if this parser can interrupt the specified block being processed.
Close(BlockProcessor, Block)
BlockParser.csCalled when a block matched by this parser is being closed (to allow final computation on the block).
public virtual bool Close(BlockProcessor processor, Block block)Parameters
processorBlockProcessor- The parser processor.
blockBlock- The block being closed.
Returns
bool true to keep the block; false to remove it. True by default.
HasOpeningCharacter(char)
BlockParser.csTryContinue(BlockProcessor, Block)
BlockParser.csTries to continue matching a block already opened.
public virtual BlockState TryContinue(BlockProcessor processor, Block block)Parameters
processorBlockProcessor- The parser processor.
blockBlock- The block already opened.
Returns
BlockState The result of the match. By default, don't expect any newline
TryOpen(BlockProcessor)
Tries to match a block opening.
public abstract BlockState TryOpen(BlockProcessor processor)Events
| Name | Description |
|---|---|
| Closed | Occurs when a block opened by this parser is closed. The block is complete and can be post-processed. |
Closed
Occurs when a block opened by this parser is closed. The block is complete and can be post-processed.
public event ProcessBlockDelegate? Closed