A generic parser for markdown-like languages.
- author Carsten Brandt
Properties |
public $maximumNestingLevel = 32
|
Methods |
public parse( $text) Parses the given text considering the full language. This includes parsing block elements as well as inline elements.
|
public parseParagraph( $text) Parses a paragraph without block elements (block elements are ignored).
|
Properties |
protected $context = []
|
protected $escapeCharacters = ['\']
|
Methods |
protected blockTypes()
|
protected cleanup() This method will be called after You can override it to do cleanup. |
protected consumeParagraph( $lines, $current) Consume lines for a paragraph
|
protected detectLineType( $lines, $current) Given a set of lines and an index of a current line it uses the registed block types to
|
protected inlineMarkers() Returns a map of inline markers to the corresponding parser methods. This array defines handler methods for inline markdown markers. Note that markers starting with whitespace may slow down the parser, You may override this method to define a set of markers and parsing methods.
|
protected parseBlock( $lines, $current) Parses the block at current line by identifying the block type and parsing the content
|
protected parseBlocks( $lines) Parse block elements by calling |
protected parseEscape( $text) Parses escaped special characters.
|
protected parseInline( $text) Parses inline elements of the language.
|
protected prepare() This method will be called before You can override it to do some initialization work. |
protected prepareMarkers( $text) Prepare markers that are used in the text to parse Add all markers that are present in markdown.
|
protected renderAbsy( $blocks) |
protected renderParagraph( $block) Render a paragraph block
|
protected renderText( $block) This function renders plain text sections in the markdown text. It can be used to work on normal text sections for example to highlight keywords or |
Properties |
private $_blockTypes = NULL |
private $_depth = 0 |
private $_inlineMarkers = []
|