class League / CommonMark / Parser / MarkdownParser
You are viewing an older version of the documentation. For the latest, please visit 2.4 documentation.
final

MarkdownParser

Implements

Properties

private

$environment

Default: null
private

$maxNestingLevel

Default: null
private

$referenceMap

Default: null
private

$lineNumber

private

$cursor

Default: null
private

$activeBlockParsers array

Default: []
private

$closedBlockParsers array

Default: []

Methods

public

__construct ( EnvironmentInterface $environment ) : void

private

initialize ( ) : void

public

parse ( string $input ) : void

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

parseBlockContinuation ( ) : void

private

findBlockStart ( BlockContinueParserInterface $lastMatchedBlockParser ) : void

private

closeBlockParsers ( int $count , int $endLineNumber ) : void

private

finalize ( 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

processInlines ( ) : void

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

private

addChild ( BlockContinueParserInterface $blockParser ) : void

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

activateBlockParser ( BlockContinueParserInterface $blockParser ) : void

private

deactivateBlockParser ( ) : void

private

prepareActiveBlockParserForReplacement ( ) : void

private

updateReferenceMap ( iterable $references ) : void

Parameters

  • $references ReferenceInterface[]
public

getActiveBlockParser ( ) : void