HTMLPurifier 4.4.0
HTMLPurifier_Injector_AutoParagraph Class Reference

Injector that auto paragraphs text in the root node based on double-spacing. More...

Inheritance diagram for HTMLPurifier_Injector_AutoParagraph:
HTMLPurifier_Injector HTMLPurifier_Injector

List of all members.

Public Member Functions

 handleText (&$token)
 Handler that is called when a text token is processed.
 handleElement (&$token)
 Handler that is called when a start or empty token is processed.
 handleText (&$token)
 Handler that is called when a text token is processed.
 handleElement (&$token)
 Handler that is called when a start or empty token is processed.

Public Attributes

 $name = 'AutoParagraph'
 Advisory name of injector, this is for friendly error messages.
 $needed = array('p')
 Array of elements and attributes this injector creates and therefore need to be allowed by the definition.

Private Member Functions

 _pStart ()
 _splitText ($data, &$result)
 Splits up a text in paragraph tokens and appends them to the result stream that will replace the original.
 _isInline ($token)
 Returns true if passed token is inline (and, ergo, allowed in paragraph tags)
 _pLookAhead ()
 Looks ahead in the token list and determines whether or not we need to insert a.
 _checkNeedsP ($current)
 Determines if a particular token requires an earlier inline token to get a paragraph.
 _pStart ()
 _splitText ($data, &$result)
 Splits up a text in paragraph tokens and appends them to the result stream that will replace the original.
 _isInline ($token)
 Returns true if passed token is inline (and, ergo, allowed in paragraph tags)
 _pLookAhead ()
 Looks ahead in the token list and determines whether or not we need to insert a.
 _checkNeedsP ($current)
 Determines if a particular token requires an earlier inline token to get a paragraph.

Detailed Description

Injector that auto paragraphs text in the root node based on double-spacing.

Todo:

Ensure all states are unit tested, including variations as well.

Make a graph of the flow control for this Injector.

Todo:

Ensure all states are unit tested, including variations as well.

Make a graph of the flow control for this Injector.

Definition at line 9 of file AutoParagraph.php.


Member Function Documentation

HTMLPurifier_Injector_AutoParagraph::_checkNeedsP ( current) [private]

Determines if a particular token requires an earlier inline token to get a paragraph.

This should be used with _forwardUntilEndToken

Definition at line 322 of file AutoParagraph.php.

References _isInline().

Referenced by _pLookAhead().

HTMLPurifier_Injector_AutoParagraph::_checkNeedsP ( current) [private]

Determines if a particular token requires an earlier inline token to get a paragraph.

This should be used with _forwardUntilEndToken

Definition at line 14331 of file HTMLPurifier.standalone.php.

References _isInline().

HTMLPurifier_Injector_AutoParagraph::_isInline ( token) [private]

Returns true if passed token is inline (and, ergo, allowed in paragraph tags)

Definition at line 14304 of file HTMLPurifier.standalone.php.

HTMLPurifier_Injector_AutoParagraph::_isInline ( token) [private]

Returns true if passed token is inline (and, ergo, allowed in paragraph tags)

Definition at line 295 of file AutoParagraph.php.

Referenced by _checkNeedsP(), and handleElement().

HTMLPurifier_Injector_AutoParagraph::_pLookAhead ( ) [private]

Looks ahead in the token list and determines whether or not we need to insert a.

tag.

Definition at line 303 of file AutoParagraph.php.

References _checkNeedsP(), HTMLPurifier_Injector::current(), and HTMLPurifier_Injector::forwardUntilEndToken().

Referenced by handleElement(), and handleText().

HTMLPurifier_Injector_AutoParagraph::_pLookAhead ( ) [private]

Looks ahead in the token list and determines whether or not we need to insert a.

tag.

Definition at line 14312 of file HTMLPurifier.standalone.php.

References _checkNeedsP(), HTMLPurifier_Injector::current(), and HTMLPurifier_Injector::forwardUntilEndToken().

HTMLPurifier_Injector_AutoParagraph::_pStart ( ) [private]

Definition at line 15 of file AutoParagraph.php.

Referenced by _splitText(), handleElement(), and handleText().

HTMLPurifier_Injector_AutoParagraph::_pStart ( ) [private]

Definition at line 14024 of file HTMLPurifier.standalone.php.

HTMLPurifier_Injector_AutoParagraph::_splitText ( data,
&$  result 
) [private]

Splits up a text in paragraph tokens and appends them to the result stream that will replace the original.

Parameters:
$dataString text data that will be processed into paragraphs
$resultReference to array of tokens that the tags will be appended onto
$configInstance of HTMLPurifier_Config
$contextInstance of HTMLPurifier_Context

Definition at line 211 of file AutoParagraph.php.

References $data, and _pStart().

Referenced by handleText().

HTMLPurifier_Injector_AutoParagraph::_splitText ( data,
&$  result 
) [private]

Splits up a text in paragraph tokens and appends them to the result stream that will replace the original.

Parameters:
$dataString text data that will be processed into paragraphs
$resultReference to array of tokens that the tags will be appended onto
$configInstance of HTMLPurifier_Config
$contextInstance of HTMLPurifier_Context

Definition at line 14220 of file HTMLPurifier.standalone.php.

References $data, and _pStart().

HTMLPurifier_Injector_AutoParagraph::handleElement ( &$  token)

Handler that is called when a start or empty token is processed.

Reimplemented from HTMLPurifier_Injector.

Definition at line 14106 of file HTMLPurifier.standalone.php.

References _isInline(), _pLookAhead(), _pStart(), HTMLPurifier_Injector::allowsElement(), and HTMLPurifier_Injector::backward().

HTMLPurifier_Injector_AutoParagraph::handleElement ( &$  token)

Handler that is called when a start or empty token is processed.

Reimplemented from HTMLPurifier_Injector.

Definition at line 97 of file AutoParagraph.php.

References _isInline(), _pLookAhead(), _pStart(), HTMLPurifier_Injector::allowsElement(), and HTMLPurifier_Injector::backward().

HTMLPurifier_Injector_AutoParagraph::handleText ( &$  token)

Handler that is called when a text token is processed.

Reimplemented from HTMLPurifier_Injector.

Definition at line 14030 of file HTMLPurifier.standalone.php.

References _pLookAhead(), _pStart(), _splitText(), HTMLPurifier_Injector::allowsElement(), and HTMLPurifier_Injector::forwardUntilEndToken().

HTMLPurifier_Injector_AutoParagraph::handleText ( &$  token)

Handler that is called when a text token is processed.

Reimplemented from HTMLPurifier_Injector.

Definition at line 21 of file AutoParagraph.php.

References _pLookAhead(), _pStart(), _splitText(), HTMLPurifier_Injector::allowsElement(), and HTMLPurifier_Injector::forwardUntilEndToken().


Member Data Documentation

HTMLPurifier_Injector_AutoParagraph::$name = 'AutoParagraph'

Advisory name of injector, this is for friendly error messages.

Reimplemented from HTMLPurifier_Injector.

Definition at line 12 of file AutoParagraph.php.

HTMLPurifier_Injector_AutoParagraph::$needed = array('p')

Array of elements and attributes this injector creates and therefore need to be allowed by the definition.

Takes form of array('element' => array('attr', 'attr2'), 'element2')

Reimplemented from HTMLPurifier_Injector.

Definition at line 13 of file AutoParagraph.php.


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