Copied!
CloneableFinalInstantiable
Methods
public __construct(League\CommonMark\Environment\EnvironmentInterface $environment)
public getActiveBlockParser() : League\CommonMark\Parser\Block\BlockContinueParserInterface
 
  • throws \ParserLogicException
public parse(string $input) : League\CommonMark\Node\Block\Document
 
  • throws \CommonMarkException
Properties
private array $activeBlockParsers = []
 
  • var array<int,\BlockContinueParserInterface>
  • psalm-readonly-allow-private-mutation
private array $closedBlockParsers = []
 
  • var array<int,\BlockContinueParserWithInlinesInterface>
  • psalm-readonly-allow-private-mutation
private League\CommonMark\Parser\Cursor $cursor
 
  • psalm-readonly-allow-private-mutation
private League\CommonMark\Environment\EnvironmentInterface $environment
 
  • psalm-readonly
private int $lineNumber = 0
 
  • psalm-readonly-allow-private-mutation
private int $maxNestingLevel
 
  • psalm-readonly-allow-private-mutation
private League\CommonMark\Reference\ReferenceMap $referenceMap
 
  • psalm-readonly-allow-private-mutation
Methods
private activateBlockParser(League\CommonMark\Parser\Block\BlockContinueParserInterface $blockParser) : void
private addChild(League\CommonMark\Parser\Block\BlockContinueParserInterface $blockParser, ?int $startLineNumber = NULL) : League\CommonMark\Parser\Block\BlockContinueParserInterface
 

Add block of type tag as a child of the tip. If the tip can't accept children, close and finalize it and try its parent, and so on til we find a block that can accept children.

private closeBlockParsers(int $count, int $endLineNumber) : void
private deactivateBlockParser() : League\CommonMark\Parser\Block\BlockContinueParserInterface
 
  • throws \ParserLogicException
private finalize(League\CommonMark\Parser\Block\BlockContinueParserInterface $blockParser, int $endLineNumber) : void
 

Finalize a block. Close it and do any necessary postprocessing, e.g. creating string_content from strings, setting the 'tight' or 'loose' status of a list, and parsing the beginnings of paragraphs for reference definitions.

private findBlockStart(League\CommonMark\Parser\Block\BlockContinueParserInterface $lastMatchedBlockParser) : ?League\CommonMark\Parser\Block\BlockStart
private initialize() : void
private parseBlockContinuation() : ?int
private parseLine(string $line) : void
 

Analyze a line of text and update the document appropriately. We parse markdown text by calling this on each line of input, then finalizing the document.

private prepareActiveBlockParserForReplacement() : ?int
 
  • return int|null The line number where the old block started
private processInlines() : void
 

Walk through a block & children recursively, parsing string content into inline content where appropriate.

private updateReferenceMap(iterable $references) : void
 
  • param \ReferenceInterface[] $references
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration