Class cebe\markdown\GithubMarkdown

Inheritancecebe\markdown\GithubMarkdown » 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, cebe\markdown\inline\StrikeoutTrait, cebe\markdown\inline\UrlLinkTrait

Markdown parser for github flavored markdown.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$enableNewlines boolean Whether to interpret newlines as <br />-tags. cebe\markdown\GithubMarkdown
$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\GithubMarkdown
$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\block\FencedCodeTrait
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\GithubMarkdown
consumeQuote() Consume lines for a blockquote element cebe\markdown\block\QuoteTrait
consumeReference() Consume link references cebe\markdown\inline\LinkTrait
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\inline\LinkTrait
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\block\TableTrait
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
parseStrike() Parses the strikethrough feature. cebe\markdown\inline\StrikeoutTrait
parseTd() cebe\markdown\block\TableTrait
parseUrl() Parses urls and adds auto linking feature. cebe\markdown\inline\UrlLinkTrait
prepare() This method will be called before parse() and parseParagraph(). cebe\markdown\Markdown
renderAbsy() cebe\markdown\block\TableTrait
renderAutoUrl() cebe\markdown\inline\UrlLinkTrait
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
renderStrike() cebe\markdown\inline\StrikeoutTrait
renderStrong() cebe\markdown\inline\EmphStrongTrait
renderTable() Render a table block cebe\markdown\block\TableTrait
renderText() cebe\markdown\GithubMarkdown
renderUrl() cebe\markdown\inline\LinkTrait

Property Details

$enableNewlines public property

Whether to interpret newlines as <br />-tags. This feature is useful for comments where newlines are often meant to be real new lines.

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

Method Details

consumeParagraph() protected method

Consume lines for a paragraph

Allow headlines, lists and code to break paragraphs

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

protected void renderText ( $text )