Trait cebe\markdown\block\HtmlTrait
Implemented by | cebe\markdown\GithubMarkdown, cebe\markdown\Markdown, cebe\markdown\MarkdownExtra |
---|
Adds inline and block HTML support
Protected Properties
Property | Type | Description | Defined 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
Method | Description | Defined 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
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']
HTML elements known to be self-closing.
Method Details
Consume lines for an HTML block
protected void consumeHtml ( $lines, $current ) | ||
$lines | ||
$current |
Identify a line as the beginning of a HTML block.
protected void identifyHtml ( $line, $lines, $current ) | ||
$line | ||
$lines | ||
$current |
Parses an & or a html entity definition.
protected void parseEntity ( $text ) | ||
$text |
Escapes >
characters.
protected void parseGt ( $text ) | ||
$text |
Parses inline HTML.
protected void parseInlineHtml ( $text ) | ||
$text |
Renders an HTML block
protected void renderHtml ( $block ) | ||
$block |
Renders a html entity.
protected void renderInlineHtml ( $block ) | ||
$block |