Trait cebe\markdown\block\HtmlTrait

Implemented bycebe\markdown\GithubMarkdown, cebe\markdown\Markdown, cebe\markdown\MarkdownExtra

Adds inline and block HTML support

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$inlineHtmlElements array HTML elements considered as inline elements. cebe\markdown\block\HtmlTrait
$selfClosingHtmlElements array HTML elements known to be self-closing. cebe\markdown\block\HtmlTrait

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
consumeHtml() Consume lines for an HTML block cebe\markdown\block\HtmlTrait
identifyHtml() Identify a line as the beginning of a HTML block. cebe\markdown\block\HtmlTrait
parseEntity() Parses an & or a html entity definition. cebe\markdown\block\HtmlTrait
parseGt() Escapes > characters. cebe\markdown\block\HtmlTrait
parseInlineHtml() Parses inline HTML. cebe\markdown\block\HtmlTrait
renderHtml() Renders an HTML block cebe\markdown\block\HtmlTrait
renderInlineHtml() Renders a html entity. cebe\markdown\block\HtmlTrait

Property Details

$inlineHtmlElements protected property

HTML elements considered as inline elements.

See also http://www.w3.org/wiki/HTML/Elements#Text-level_semantics.

protected array $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']
$selfClosingHtmlElements protected property

HTML elements known to be self-closing.

protected array $selfClosingHtmlElements = ['br''hr''img''input''nobr']

Method Details

consumeHtml() protected method

Consume lines for an HTML block

protected void consumeHtml ( $lines, $current )
$lines
$current
identifyHtml() protected method

Identify a line as the beginning of a HTML block.

protected void identifyHtml ( $line, $lines, $current )
$line
$lines
$current
parseEntity() protected method

Parses an & or a html entity definition.

protected void parseEntity ( $text )
$text
parseGt() protected method

Escapes > characters.

protected void parseGt ( $text )
$text
parseInlineHtml() protected method

Parses inline HTML.

protected void parseInlineHtml ( $text )
$text
renderHtml() protected method

Renders an HTML block

protected void renderHtml ( $block )
$block
renderInlineHtml() protected method

Renders a html entity.

protected void renderInlineHtml ( $block )
$block