Class cebe\markdown\MarkdownExtra

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

Markdown parser for the markdown extra flavor.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$codeAttributesOnPre bool Whether special attributes on code blocks should be applied on the <pre> element. cebe\markdown\MarkdownExtra
$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 cebe\markdown\MarkdownExtra
$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
consumeFencedCode() Consume lines for a fenced code block cebe\markdown\MarkdownExtra
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\MarkdownExtra
consumeTable() Consume lines for a table cebe\markdown\block\TableTrait
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
identifyFencedCode() Identify a line as the beginning of a fenced code block. cebe\markdown\block\FencedCodeTrait
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\MarkdownExtra
identifyTable() Identify a line as the beginning of a table block. cebe\markdown\block\TableTrait
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\MarkdownExtra
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
parseSpecialAttributes() cebe\markdown\MarkdownExtra
parseTd() cebe\markdown\block\TableTrait
prepare() This method will be called before parse() and parseParagraph(). cebe\markdown\Markdown
renderAbsy() cebe\markdown\block\TableTrait
renderAttributes() cebe\markdown\MarkdownExtra
renderCode() cebe\markdown\MarkdownExtra
renderEmail() cebe\markdown\inline\LinkTrait
renderEmph() cebe\markdown\inline\EmphStrongTrait
renderHeadline() Renders a headline cebe\markdown\MarkdownExtra
renderHr() Renders a horizontal rule cebe\markdown\block\RuleTrait
renderHtml() Renders an HTML block cebe\markdown\block\HtmlTrait
renderImage() cebe\markdown\MarkdownExtra
renderInlineCode() cebe\markdown\inline\CodeTrait
renderInlineHtml() Renders a html entity. cebe\markdown\block\HtmlTrait
renderLink() cebe\markdown\MarkdownExtra
renderList() Renders a list cebe\markdown\block\ListTrait
renderParagraph() Render a paragraph block cebe\markdown\Parser
renderQuote() Renders a blockquote cebe\markdown\block\QuoteTrait
renderSpecialAttributes() cebe\markdown\MarkdownExtra
renderStrong() cebe\markdown\inline\EmphStrongTrait
renderTable() Render a table block cebe\markdown\block\TableTrait
renderText() cebe\markdown\Markdown
renderUrl() cebe\markdown\inline\LinkTrait

Property Details

$codeAttributesOnPre public property

Whether special attributes on code blocks should be applied on the <pre> element. The default behavior is to put them on the <code> element.

public bool $codeAttributesOnPre false
$escapeCharacters protected property
protected $escapeCharacters = ['\\''`''*''_''{''}''['']''('')''#''+''-''.''!''<''>'':''|']

Method Details

consumeFencedCode() protected method

Consume lines for a fenced code block

protected void consumeFencedCode ( $lines, $current )
consumeReference() protected method

Consume link references

protected void consumeReference ( $lines, $current )
identifyReference() protected method

protected void identifyReference ( $line )
parseInline() protected method

protected void parseInline ( $text )
parseSpecialAttributes() protected method

protected void parseSpecialAttributes ( $text )
renderAttributes() protected method

protected void renderAttributes ( $block )
renderCode() protected method

protected void renderCode ( $block )
renderHeadline() protected method

Renders a headline

protected void renderHeadline ( $block )
renderImage() protected method

protected void renderImage ( $block )
renderLink() protected method

protected void renderLink ( $block )
renderSpecialAttributes() protected method

protected void renderSpecialAttributes ( $block )