Copied!

Adds inline and block HTML support

Trait
Properties
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']
 
  • var array HTML elements considered as inline elements.
  • see http://www.w3.org/wiki/HTML/Elements#Text-level_semantics
protected $selfClosingHtmlElements = ['br', 'hr', 'img', 'input', 'nobr']
 
  • var array HTML elements known to be self-closing.
Methods
protected consumeHtml( $lines, $current)
 

Consume lines for an HTML block

protected identifyHtml( $line, $lines, $current)
 

identify a line as the beginning of a HTML block.

protected parseEntity( $text)
 

Parses an & or a html entity definition.

  • marker &
protected parseGt( $text)
 

Escapes > characters.

  • marker >
protected parseInlineHtml( $text)
 

Parses inline HTML.

  • marker <
protected renderHtml( $block)
 

Renders an HTML block

protected renderInlineHtml( $block)
 

renders a html entity.

© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration