HumHub Documentation (unofficial)

HtmlTrait

Adds inline and block HTML support

Table of Contents

Properties

$inlineHtmlElements  : array<string|int, mixed>
$selfClosingHtmlElements  : array<string|int, mixed>

Methods

consumeHtml()  : mixed
Consume lines for an HTML block
identifyHtml()  : mixed
identify a line as the beginning of a HTML block.
parseEntity()  : mixed
Parses an & or a html entity definition.
parseGt()  : mixed
Escapes `>` characters.
parseInlineHtml()  : mixed
Parses inline HTML.
renderHtml()  : mixed
Renders an HTML block
renderInlineHtml()  : mixed
renders a html entity.

Properties

$inlineHtmlElements

protected array<string|int, mixed> $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 considered as inline elements.

Tags
see
http://www.w3.org/wiki/HTML/Elements#Text-level_semantics

$selfClosingHtmlElements

protected array<string|int, mixed> $selfClosingHtmlElements = ['br', 'hr', 'img', 'input', 'nobr']

HTML elements known to be self-closing.

Methods

consumeHtml()

Consume lines for an HTML block

protected consumeHtml(mixed $lines, mixed $current) : mixed
Parameters
$lines : mixed
$current : mixed

identifyHtml()

identify a line as the beginning of a HTML block.

protected identifyHtml(mixed $line, mixed $lines, mixed $current) : mixed
Parameters
$line : mixed
$lines : mixed
$current : mixed

parseEntity()

Parses an & or a html entity definition.

protected parseEntity(mixed $text) : mixed
Parameters
$text : mixed
Tags
marker

&

parseGt()

Escapes `>` characters.

protected parseGt(mixed $text) : mixed
Parameters
$text : mixed
Tags
marker

parseInlineHtml()

Parses inline HTML.

protected parseInlineHtml(mixed $text) : mixed
Parameters
$text : mixed
Tags
marker

<

renderHtml()

Renders an HTML block

protected renderHtml(mixed $block) : mixed
Parameters
$block : mixed

renderInlineHtml()

renders a html entity.

protected renderInlineHtml(mixed $block) : mixed
Parameters
$block : mixed

        
On this page

Search results