Markdown parser for the initial markdown spec.
- author Carsten Brandt
Properties |
public $html5 = false
|
public $keepListStartNumber = false
|
Methods |
Properties |
protected $escapeCharacters = ['\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '#', '+', '-', '.', '!', '<', '>']
|
protected $inlineHtmlElements = ['a', 'abbr', 'acronym', 'b', 'basefont', 'bdo', 'big', 'br', 'button', 'blink', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'img', 'ins', 'input', 'iframe', 'kbd', 'label', 'listing', 'map', 'mark', 'nobr', 'object', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'select', 'small', 'spacer', 'span', 'strong', 'sub', 'sup', 'tt', 'var', 'u', 'wbr', 'time']
|
protected $references = []
|
protected $selfClosingHtmlElements = ['br', 'hr', 'img', 'input', 'nobr']
|
Methods |
protected consumeAHr( $lines, $current) Consume a horizontal rule |
protected consumeBUl( $lines, $current) Consume lines for an unordered list |
protected consumeCode( $lines, $current) Consume lines for a code block element |
protected consumeHeadline( $lines, $current) Consume lines for a headline |
protected consumeHr( $lines, $current) Consume a horizontal rule |
protected consumeHtml( $lines, $current) Consume lines for an HTML block |
protected consumeOl( $lines, $current) Consume lines for an ordered list |
protected consumeParagraph( $lines, $current) Consume lines for a paragraph Allow headlines and code to break paragraphs |
protected consumeQuote( $lines, $current) Consume lines for a blockquote element |
protected consumeReference( $lines, $current) Consume link references |
protected consumeUl( $lines, $current) Consume lines for an unordered list |
protected identifyAHr( $line) identify a line as a horizontal rule. |
protected identifyBUl( $line) identify a line as the beginning of an unordered list. |
protected identifyCode( $line) identify a line as the beginning of a code block. |
protected identifyHeadline( $line, $lines, $current) identify a line as a headline |
protected identifyHr( $line) identify a line as a horizontal rule. |
protected identifyHtml( $line, $lines, $current) identify a line as the beginning of a HTML block. |
protected identifyOl( $line) identify a line as the beginning of an ordered list. |
protected identifyQuote( $line) identify a line as the beginning of a block quote. |
protected identifyReference( $line) |
protected identifyUl( $line) identify a line as the beginning of an unordered list. |
protected lookupReference( $key) |
protected parseEmphStrong( $text) Parses emphasized and strong elements.
|
protected parseEntity( $text) Parses an & or a html entity definition.
|
protected parseGt( $text) Escapes
|
protected parseImage( $markdown) Parses an image indicated by
|
protected parseInlineCode( $text) Parses an inline code span
|
protected parseLink( $markdown) Parses a link indicated by
|
protected parseLinkOrImage( $markdown) |
protected parseLt( $text) Parses inline HTML.
|
protected prepare() You can override it to do some initialization work. |
protected renderCode( $block) Renders a code block |
protected renderEmail( $block) |
protected renderEmph( $block) |
protected renderHeadline( $block) Renders a headline |
protected renderHr( $block) Renders a horizontal rule |
protected renderHtml( $block) Renders an HTML block |
protected renderImage( $block) |
protected renderInlineCode( $block) |
protected renderInlineHtml( $block) renders a html entity. |
protected renderLink( $block) |
protected renderList( $block) Renders a list |
protected renderQuote( $block) Renders a blockquote |
protected renderStrong( $block) |
protected renderText( $text) It can be used to work on normal text sections for example to highlight keywords or |
protected renderUrl( $block) |
protected replaceEscape( $text) Remove backslash from escaped characters
|
Methods |
private consumeList( $lines, $current, $block, $type) |
private generateHtmlAttributes( $attributes) Return html attributes string from [attrName => attrValue] list
|
private parseInlineHtml( $text) Parses inline HTML.
|