ILIAS
Release_5_0_x_branch Revision 61816
|
Injector that auto paragraphs text in the root node based on double-spacing. More...
Public Member Functions | |
handleText (&$token) | |
handleElement (&$token) | |
Public Member Functions inherited from HTMLPurifier_Injector | |
rewindOffset ($offset) | |
Rewind to a spot to re-perform processing. | |
getRewindOffset () | |
Retrieves rewind offset, and then unsets it. | |
prepare ($config, $context) | |
Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. | |
checkNeeded ($config) | |
This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled. | |
allowsElement ($name) | |
Tests if the context node allows a certain element. | |
handleEnd (&$token) | |
Handler that is called when an end token is processed. | |
notifyEnd ($token) | |
Notifier that is called when an end token is processed. |
Data Fields | |
$name = 'AutoParagraph' | |
string | |
$needed = array('p') | |
array | |
Data Fields inherited from HTMLPurifier_Injector | |
$name | |
Advisory name of injector, this is for friendly error messages. | |
$needed = array() | |
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. |
Additional Inherited Members | |
Protected Member Functions inherited from HTMLPurifier_Injector | |
forward (&$i, &$current) | |
Iterator function, which starts with the next token and continues until you reach the end of the input tokens. | |
forwardUntilEndToken (&$i, &$current, &$nesting) | |
Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in. | |
backward (&$i, &$current) | |
Iterator function, starts with the previous token and continues until you reach the beginning of input tokens. | |
Protected Attributes inherited from HTMLPurifier_Injector | |
$htmlDefinition | |
HTMLPurifier_HTMLDefinition | |
$currentNesting | |
Reference to CurrentNesting variable in Context. | |
$currentToken | |
Reference to current token. | |
$inputZipper | |
Reference to InputZipper variable in Context. | |
$rewindOffset = false | |
Number of elements to rewind backwards (relative). |
Injector that auto paragraphs text in the root node based on double-spacing.
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.
|
private |
Determines if a particular token requires an earlier inline token to get a paragraph.
This should be used with _forwardUntilEndToken
HTMLPurifier_Token | $current |
Definition at line 333 of file AutoParagraph.php.
References _isInline().
Referenced by _pLookAhead().
|
private |
Returns true if passed token is inline (and, ergo, allowed in paragraph tags)
HTMLPurifier_Token | $token |
Definition at line 298 of file AutoParagraph.php.
Referenced by _checkNeedsP(), and handleElement().
|
private |
Looks ahead in the token list and determines whether or not we need to insert a.
tag.
Definition at line 308 of file AutoParagraph.php.
References $ok, $result, _checkNeedsP(), and HTMLPurifier_Injector\forwardUntilEndToken().
Referenced by handleElement(), and handleText().
|
private |
Definition at line 24 of file AutoParagraph.php.
Referenced by _splitText(), handleElement(), and handleText().
|
private |
Splits up a text in paragraph tokens and appends them to the result stream that will replace the original.
string | $data | String text data that will be processed into paragraphs |
HTMLPurifier_Token[] | $result Reference to array of tokens that the tags will be appended onto |
Definition at line 212 of file AutoParagraph.php.
References $result, and _pStart().
Referenced by handleText().
HTMLPurifier_Injector_AutoParagraph::handleElement | ( | & | $token | ) |
HTMLPurifier_Token | $token |
Reimplemented from HTMLPurifier_Injector.
Definition at line 112 of file AutoParagraph.php.
References _isInline(), _pLookAhead(), _pStart(), HTMLPurifier_Injector\allowsElement(), and HTMLPurifier_Injector\backward().
HTMLPurifier_Injector_AutoParagraph::handleText | ( | & | $token | ) |
HTMLPurifier_Token_Text | $token |
Reimplemented from HTMLPurifier_Injector.
Definition at line 34 of file AutoParagraph.php.
References _pLookAhead(), _pStart(), _splitText(), HTMLPurifier_Injector\allowsElement(), and HTMLPurifier_Injector\forwardUntilEndToken().
HTMLPurifier_Injector_AutoParagraph::$name = 'AutoParagraph' |
string
Definition at line 14 of file AutoParagraph.php.
HTMLPurifier_Injector_AutoParagraph::$needed = array('p') |
array
Definition at line 19 of file AutoParagraph.php.