ListBlockStartParser
in package
implements
BlockStartParserInterface, ConfigurationAwareInterface
FinalYes
Table of Contents
Interfaces
- BlockStartParserInterface
- Interface for a block parser which identifies block starts.
- ConfigurationAwareInterface
- Implement this class to facilitate setter injection of the configuration where needed
Properties
- $config : ConfigurationInterface|null
- $listMarkerRegex : string|null
Methods
- setConfiguration() : void
- tryStart() : BlockStart|null
- Check whether we should handle the block at the current position
- calculateListMarkerPadding() : int
- generateListMarkerRegex() : string
- parseList() : ListData|null
Properties
$config
private
ConfigurationInterface|null
$config
= null
Tags
$listMarkerRegex
private
string|null
$listMarkerRegex
= null
Tags
Methods
setConfiguration()
public
setConfiguration(ConfigurationInterface $configuration) : void
Parameters
- $configuration : ConfigurationInterface
tryStart()
Check whether we should handle the block at the current position
public
tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState) : BlockStart|null
Parameters
- $cursor : Cursor
-
A cloned copy of the cursor at the current parsing location
- $parserState : MarkdownParserStateInterface
-
Additional information about the state of the Markdown parser
Return values
BlockStart|null —The BlockStart that has been identified, or null if the block doesn't match here
calculateListMarkerPadding()
private
static calculateListMarkerPadding(Cursor $cursor, int $markerLength) : int
Parameters
- $cursor : Cursor
- $markerLength : int
Return values
intgenerateListMarkerRegex()
private
generateListMarkerRegex() : string
Tags
Return values
stringparseList()
private
parseList(Cursor $cursor, bool $inParagraph) : ListData|null
Parameters
- $cursor : Cursor
- $inParagraph : bool