Elgg  Version 5.1
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Elgg\Views\AutoParagraph Class Reference

Create wrapper P and BR elements in HTML depending on newlines. More...

Public Member Functions

 __construct ()
 Constructor. More...
 
 process ($html)
 Create wrapper P and BR elements in HTML depending on newlines. More...
 

Public Attributes

 $encoding = 'UTF-8'
 

Protected Member Functions

 addParagraphs (\DOMElement $el)
 Add P and BR elements as necessary. More...
 

Protected Attributes

 $_doc = null
 
 $_xpath = null
 
 $_blocks
 
 $_inlines
 
 $_descendList
 
 $_alterList
 
 $_unique = ''
 

Detailed Description

Create wrapper P and BR elements in HTML depending on newlines.

Useful when users use newlines to signal line and paragraph breaks. In all cases output should be well-formed markup.

In DIV elements, Ps are only added when there would be at least two of them.

Definition at line 15 of file AutoParagraph.php.

Constructor & Destructor Documentation

Elgg\Views\AutoParagraph::__construct ( )

Constructor.

Definition at line 72 of file AutoParagraph.php.

Member Function Documentation

Elgg\Views\AutoParagraph::addParagraphs ( \DOMElement  $el)
protected

Add P and BR elements as necessary.

Parameters
\DOMElement$elDOM element
Returns
void

Definition at line 220 of file AutoParagraph.php.

Elgg\Views\AutoParagraph::process (   $html)

Create wrapper P and BR elements in HTML depending on newlines.

Useful when users use newlines to signal line and paragraph breaks. In all cases output should be well-formed markup.

In DIV, LI, TD, and TH elements, Ps are only added when their would be at least two of them.

Parameters
string$htmlsnippet
Returns
string|false output or false if parse error occurred
Exceptions

Definition at line 93 of file AutoParagraph.php.

Member Data Documentation

Elgg\Views\AutoParagraph::$_alterList
protected
Initial value:
= 'article aside blockquote body details div footer header
section'

Definition at line 61 of file AutoParagraph.php.

Elgg\Views\AutoParagraph::$_blocks
protected
Initial value:
= 'address article area aside blockquote caption col colgroup dd
details div dl dt fieldset figure figcaption footer form h1 h2 h3 h4 h5 h6 header
hr hgroup legend map math menu nav noscript p pre section select style summary
table tbody td tfoot th thead tr ul ol option li'

Definition at line 35 of file AutoParagraph.php.

Elgg\Views\AutoParagraph::$_descendList
protected
Initial value:
= 'article aside blockquote body details div footer form
header section'

Definition at line 53 of file AutoParagraph.php.

Elgg\Views\AutoParagraph::$_doc = null
protected

Definition at line 25 of file AutoParagraph.php.

Elgg\Views\AutoParagraph::$_inlines
protected
Initial value:
= 'a abbr audio b button canvas caption cite code command datalist
del dfn em embed i iframe img input ins kbd keygen label map mark meter object
output progress q rp rt ruby s samp script select small source span strong style
sub sup textarea time var video wbr'

Definition at line 43 of file AutoParagraph.php.

Elgg\Views\AutoParagraph::$_unique = ''
protected

Definition at line 67 of file AutoParagraph.php.

Elgg\Views\AutoParagraph::$_xpath = null
protected

Definition at line 30 of file AutoParagraph.php.

Elgg\Views\AutoParagraph::$encoding = 'UTF-8'

Definition at line 20 of file AutoParagraph.php.


The documentation for this class was generated from the following file: