Class cebe\markdown\Markdown
Markdown parser for the initial markdown spec.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$html5 | boolean | Whether to format markup according to HTML5 spec. | cebe\markdown\Markdown |
$keepListStartNumber | bool | Enable support start attribute of ordered lists. |
cebe\markdown\block\ListTrait |
$maximumNestingLevel | integer | The maximum nesting level for language elements. | cebe\markdown\Parser |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$context | string | The current context the parser is in. | cebe\markdown\Parser |
$escapeCharacters | array | These are "escapeable" characters. | cebe\markdown\Markdown |
$inlineHtmlElements | array | HTML elements considered as inline elements. | cebe\markdown\block\HtmlTrait |
$references | array | A list of defined references in this document. | cebe\markdown\inline\LinkTrait |
$selfClosingHtmlElements | array | HTML elements known to be self-closing. | cebe\markdown\block\HtmlTrait |
Public Methods
Method | Description | Defined By |
---|---|---|
parse() | Parses the given text considering the full language. | cebe\markdown\Parser |
parseParagraph() | Parses a paragraph without block elements (block elements are ignored). | cebe\markdown\Parser |
Protected Methods
Property Details
These are "escapeable" characters. When using one of these prefixed with a backslash, the character will be outputted without the backslash and is not interpreted as markdown.
protected array $escapeCharacters = ['\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '#', '+', '-', '.', '!', '<', '>']
Whether to format markup according to HTML5 spec.
Defaults to false
which means that markup is formatted as HTML4.
Method Details
Consume lines for a paragraph
Allow headlines and code to break paragraphs
protected void consumeParagraph ( $lines, $current ) | ||
$lines | ||
$current |
This method will be called before parse()
and parseParagraph()
.
You can override it to do some initialization work.
protected void prepare ( ) |
protected void renderText ( $text ) | ||
$text |