Class HTMLPurifier_Injector
Injects tokens into the document while parsing for well-formedness. This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.
A note on how handlers create changes; this is done by assigning a new value to the $token reference. These values can take a variety of forms and are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() documentation.
Direct known subclasses
HTMLPurifier_Injector_AutoParagraph, HTMLPurifier_Injector_DisplayLinkURI, HTMLPurifier_Injector_Linkify, HTMLPurifier_Injector_PurifierLinkify, HTMLPurifier_Injector_RemoveEmpty, HTMLPurifier_Injector_RemoveSpansWithoutAttributes, HTMLPurifier_Injector_SafeObject
public
|
#
rewindOffset( boolean|integer $offset )
Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully. |
public
boolean|integer
|
|
public
boolean|string
|
#
prepare(
Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()). |
public
boolean|string
|
#
checkNeeded(
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. |
public
boolean
|
|
protected
boolean
|
#
forward( integer & $i,
Iterator function, which starts with the next token and continues until you reach the end of the input tokens. |
protected
boolean
|
#
forwardUntilEndToken( integer & $i,
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. |
protected
boolean
|
#
backward( integer & $i,
Iterator function, starts with the previous token and continues until you reach the beginning of input tokens. |
public
|
|
public
|
|
public
|
public
mixed
|
$name |
|
#
Advisory name of injector, this is for friendly error messages. |
protected
mixed
|
$htmlDefinition |
|
|
protected
mixed
|
$currentNesting |
|
#
Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside" |
protected
mixed
|
$currentToken |
|
#
Reference to current token. |
protected
mixed
|
$inputZipper |
|
#
Reference to InputZipper variable in Context. |
public
array
|
$needed | array() |
#
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') |
protected
boolean
|
$rewindOffset | false |
#
Number of elements to rewind backwards (relative). |