$name
$name :
Advisory name of injector, this is for friendly error messages.
Injector that auto paragraphs text in the root node based on double-spacing.
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.
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.
| boolean|integer | $offset |
prepare(\HTMLPurifier_Config $config, \HTMLPurifier_Context $context) : boolean|string
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()).
| \HTMLPurifier_Config | $config | |
| \HTMLPurifier_Context | $context |
Boolean false if success, string of missing needed element/attribute if failure
checkNeeded(\HTMLPurifier_Config $config) : boolean|string
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.
| \HTMLPurifier_Config | $config |
Boolean false if success, string of missing needed element/attribute if failure
handleText(\HTMLPurifier_Token_Text $token)
Handler that is called when a text token is processed
| \HTMLPurifier_Token_Text | $token |
handleElement(\HTMLPurifier_Token $token)
Handler that is called when a start or empty token is processed
| \HTMLPurifier_Token | $token |
notifyEnd(\HTMLPurifier_Token $token)
Notifier that is called when an end token is processed
| \HTMLPurifier_Token | $token | Current token variable. |
forward(integer $i, \HTMLPurifier_Token $current) : boolean
Iterator function, which starts with the next token and continues until you reach the end of the input tokens.
| integer | $i | Current integer index variable for inputTokens |
| \HTMLPurifier_Token | $current | Current token variable. Do NOT use $token, as that variable is also a reference |
| warning |
Please prevent previous references from interfering with this functions by setting $i = null beforehand! |
|---|
forwardUntilEndToken(integer $i, \HTMLPurifier_Token $current, integer $nesting) : boolean
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.
| integer | $i | Current integer index variable for inputTokens |
| \HTMLPurifier_Token | $current | Current token variable. Do NOT use $token, as that variable is also a reference |
| integer | $nesting |
| None found |
backward(integer $i, \HTMLPurifier_Token $current) : boolean
Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.
| integer | $i | Current integer index variable for inputTokens |
| \HTMLPurifier_Token | $current | Current token variable. Do NOT use $token, as that variable is also a reference |
| warning |
Please prevent previous references from interfering with this functions by setting $i = null beforehand! |
|---|
_pStart() : \HTMLPurifier_Token_Start
| None found |
_splitText(string $data, array<mixed,\HTMLPurifier_Token> $result)
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 |
| array<mixed,\HTMLPurifier_Token> | $result | Reference to array of tokens that the tags will be appended onto |
| None found |
_isInline(\HTMLPurifier_Token $token) : boolean
Returns true if passed token is inline (and, ergo, allowed in paragraph tags)
| \HTMLPurifier_Token | $token |
| None found |
_pLookAhead() : boolean
Looks ahead in the token list and determines whether or not we need to insert a <p> tag.
| None found |
_checkNeedsP(\HTMLPurifier_Token $current) : boolean
Determines if a particular token requires an earlier inline token to get a paragraph. This should be used with _forwardUntilEndToken
| \HTMLPurifier_Token | $current |
| None found |