Documentation

MarkdownParser
in package
implements MarkdownParserInterface

FinalYes

Table of Contents

Interfaces

MarkdownParserInterface

Properties

$activeBlockParsers  : array<int, BlockContinueParserInterface>
$closedBlockParsers  : array<int, BlockContinueParserWithInlinesInterface>
$cursor  : Cursor
$environment  : EnvironmentInterface
$lineNumber  : int
$maxNestingLevel  : int
$referenceMap  : ReferenceMap

Methods

__construct()  : mixed
getActiveBlockParser()  : BlockContinueParserInterface
parse()  : Document
activateBlockParser()  : void
addChild()  : 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.
closeBlockParsers()  : void
deactivateBlockParser()  : BlockContinueParserInterface
finalize()  : 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.
findBlockStart()  : BlockStart|null
initialize()  : void
parseBlockContinuation()  : int|null
parseLine()  : 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.
prepareActiveBlockParserForReplacement()  : int|null
processInlines()  : void
Walk through a block & children recursively, parsing string content into inline content where appropriate.
updateReferenceMap()  : void

Properties

$lineNumber

private int $lineNumber = 0
Tags
psalm-readonly-allow-private-mutation

$maxNestingLevel

private int $maxNestingLevel
Tags
psalm-readonly-allow-private-mutation

Methods

closeBlockParsers()

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

finalize()

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 finalize(BlockContinueParserInterface $blockParser, int $endLineNumber) : void
Parameters
$blockParser : BlockContinueParserInterface
$endLineNumber : int

parseBlockContinuation()

private parseBlockContinuation() : int|null
Return values
int|null

parseLine()

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 parseLine(string $line) : void
Parameters
$line : string

prepareActiveBlockParserForReplacement()

private prepareActiveBlockParserForReplacement() : int|null
Return values
int|null

The line number where the old block started

processInlines()

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

private processInlines(int $inputSize) : void
Parameters
$inputSize : int

        
On this page

Search results