Parsoid
A bidirectional parser between wikitext and HTML5
|
OnlyInclude sadly forces synchronous template processing, as it needs to hold onto all tokens in case an onlyinclude block is encountered later. More...
Public Member Functions | ||||
__construct (TokenTransformManager $manager, array $options) | ||||
onAny ( $token) | ||||
This handler is called for all tokens in the token stream except if (a) The more specific handlers above modified the token (b) the more specific handlers (onTag, onEnd, onNewline) have set the skip flag in their return values.(c) this handlers 'active' flag is set to false (can be set by any of the handlers).
| ||||
onTag (Token $token) | ||||
This handler is called for tokens that are not EOFTk or NLTk tokens.The handler may choose to process only specific kinds of tokens. For example, a list handler may only process 'listitem' TagTk tokens.
| ||||
Public Member Functions inherited from Wikimedia\Parsoid\Wt2Html\TT\TokenHandler | ||||
setPipelineId (int $id) | ||||
resetState (array $options) | ||||
Resets any internal state for this token handler. | ||||
isDisabled () | ||||
Is this transformer disabled? | ||||
onEnd (EOFTk $token) | ||||
This handler is called for EOF tokens only. | ||||
onNewline (NlTk $token) | ||||
This handler is called for newline tokens only. | ||||
process ( $tokens) | ||||
Push an input array of tokens through the transformer and return the transformed tokens. | ||||
Additional Inherited Members | |
Protected Attributes inherited from Wikimedia\Parsoid\Wt2Html\TT\TokenHandler | |
$env | |
$manager | |
$pipelineId | |
$options | |
$disabled | |
$onAnyEnabled | |
$atTopLevel = false | |
OnlyInclude sadly forces synchronous template processing, as it needs to hold onto all tokens in case an onlyinclude block is encountered later.
This can fortunately be worked around by caching the tokens after onlyinclude processing (which is a good idea anyway).
Wikimedia\Parsoid\Wt2Html\TT\OnlyInclude::__construct | ( | TokenTransformManager | $manager, |
array | $options ) |
TokenTransformManager | $manager | manager environment |
array | $options | options |
Reimplemented from Wikimedia\Parsoid\Wt2Html\TT\TokenHandler.
Wikimedia\Parsoid\Wt2Html\TT\OnlyInclude::onAny | ( | $token | ) |
This handler is called for all tokens in the token stream except if (a) The more specific handlers above modified the token (b) the more specific handlers (onTag, onEnd, onNewline) have set the skip flag in their return values.(c) this handlers 'active' flag is set to false (can be set by any of the handlers).
Token | string | $token | Token to be processed |
Reimplemented from Wikimedia\Parsoid\Wt2Html\TT\TokenHandler.
Wikimedia\Parsoid\Wt2Html\TT\OnlyInclude::onTag | ( | Token | $token | ) |
This handler is called for tokens that are not EOFTk or NLTk tokens.The handler may choose to process only specific kinds of tokens. For example, a list handler may only process 'listitem' TagTk tokens.
Token | $token | Token to be processed |
Reimplemented from Wikimedia\Parsoid\Wt2Html\TT\TokenHandler.