Class cebe\markdown\Markdown

Inheritancecebe\markdown\Markdown » cebe\markdown\Parser
Uses Traitscebe\markdown\block\CodeTrait, cebe\markdown\block\HeadlineTrait, cebe\markdown\block\HtmlTrait, cebe\markdown\block\ListTrait, cebe\markdown\block\QuoteTrait, cebe\markdown\block\RuleTrait, cebe\markdown\inline\CodeTrait, cebe\markdown\inline\EmphStrongTrait, cebe\markdown\inline\LinkTrait
Subclassescebe\markdown\GithubMarkdown, cebe\markdown\MarkdownExtra

Markdown parser for the initial markdown spec.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined 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

Hide inherited properties

PropertyTypeDescriptionDefined 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

Hide inherited methods

MethodDescriptionDefined 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

Hide inherited methods

MethodDescriptionDefined By
blockTypes() cebe\markdown\Parser
cleanup() This method will be called after parse() and parseParagraph(). cebe\markdown\Parser
consumeCode() Consume lines for a code block element cebe\markdown\block\CodeTrait
consumeHeadline() Consume lines for a headline cebe\markdown\block\HeadlineTrait
consumeHr() Consume a horizontal rule cebe\markdown\block\RuleTrait
consumeHtml() Consume lines for an HTML block cebe\markdown\block\HtmlTrait
consumeOl() Consume lines for an ordered list cebe\markdown\block\ListTrait
consumeParagraph() Consume lines for a paragraph cebe\markdown\Markdown
consumeQuote() Consume lines for a blockquote element cebe\markdown\block\QuoteTrait
consumeReference() Consume link references cebe\markdown\inline\LinkTrait
consumeUl() Consume lines for an unordered list cebe\markdown\block\ListTrait
detectLineType() Given a set of lines and an index of a current line it uses the registed block types to detect the type of this line. cebe\markdown\Parser
identifyCode() Identify a line as the beginning of a code block. cebe\markdown\block\CodeTrait
identifyHeadline() Identify a line as a headline cebe\markdown\block\HeadlineTrait
identifyHr() Identify a line as a horizontal rule. cebe\markdown\block\RuleTrait
identifyHtml() Identify a line as the beginning of a HTML block. cebe\markdown\block\HtmlTrait
identifyOl() Identify a line as the beginning of an ordered list. cebe\markdown\block\ListTrait
identifyQuote() Identify a line as the beginning of a block quote. cebe\markdown\block\QuoteTrait
identifyReference() cebe\markdown\inline\LinkTrait
identifyUl() Identify a line as the beginning of an unordered list. cebe\markdown\block\ListTrait
inlineMarkers() Returns a map of inline markers to the corresponding parser methods. cebe\markdown\Parser
lookupReference() cebe\markdown\inline\LinkTrait
parseBlocks() cebe\markdown\block\QuoteTrait
parseEmphStrong() Parses empathized and strong elements. cebe\markdown\inline\EmphStrongTrait
parseEntity() Parses an & or a html entity definition. cebe\markdown\block\HtmlTrait
parseEscape() Parses escaped special characters. cebe\markdown\Parser
parseGt() Escapes > characters. cebe\markdown\block\HtmlTrait
parseImage() Parses an image indicated by ![. cebe\markdown\inline\LinkTrait
parseInline() cebe\markdown\block\HeadlineTrait
parseInlineCode() Parses an inline code span `. cebe\markdown\inline\CodeTrait
parseInlineHtml() Parses inline HTML. cebe\markdown\block\HtmlTrait
parseLink() Parses a link indicated by [. cebe\markdown\inline\LinkTrait
parseLinkOrImage() cebe\markdown\inline\LinkTrait
parseLt() Parses inline HTML. cebe\markdown\inline\LinkTrait
prepare() This method will be called before parse() and parseParagraph(). cebe\markdown\Markdown
renderAbsy() cebe\markdown\block\HeadlineTrait
renderCode() Renders a code block cebe\markdown\block\CodeTrait
renderEmail() cebe\markdown\inline\LinkTrait
renderEmph() cebe\markdown\inline\EmphStrongTrait
renderHeadline() Renders a headline cebe\markdown\block\HeadlineTrait
renderHr() Renders a horizontal rule cebe\markdown\block\RuleTrait
renderHtml() Renders an HTML block cebe\markdown\block\HtmlTrait
renderImage() cebe\markdown\inline\LinkTrait
renderInlineCode() cebe\markdown\inline\CodeTrait
renderInlineHtml() Renders a html entity. cebe\markdown\block\HtmlTrait
renderLink() cebe\markdown\inline\LinkTrait
renderList() Renders a list cebe\markdown\block\ListTrait
renderParagraph() Render a paragraph block cebe\markdown\Parser
renderQuote() Renders a blockquote cebe\markdown\block\QuoteTrait
renderStrong() cebe\markdown\inline\EmphStrongTrait
renderText() cebe\markdown\Markdown
renderUrl() cebe\markdown\inline\LinkTrait

Property Details

$escapeCharacters protected property

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 = ['\\''`''*''_''{''}''['']''('')''#''+''-''.''!''<''>']
$html5 public property

Whether to format markup according to HTML5 spec. Defaults to false which means that markup is formatted as HTML4.

public boolean $html5 false

Method Details

consumeParagraph() protected method

Consume lines for a paragraph

Allow headlines and code to break paragraphs

protected void consumeParagraph ( $lines, $current )
prepare() protected method

This method will be called before parse() and parseParagraph().

You can override it to do some initialization work.

protected void prepare ( )
renderText() protected method

protected void renderText ( $text )