Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler Class Reference

Template and template argument handling. More...

+ Inheritance diagram for Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler:
+ Collaboration diagram for Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler:

Public Member Functions

 __construct (TokenTransformManager $manager, array $options)
 
 processSpecialMagicWord (bool $atTopLevel, TemplateEncapsulator $state, array $resolvedTgt)
 Process the special magic word as specified by $resolvedTgt['magicWordType'].
 
 onTag (Token $token)
 
- 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.
 
 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.
 
 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
 

Detailed Description

Template and template argument handling.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler::__construct ( TokenTransformManager $manager,
array $options )
Parameters
TokenTransformManager$manager
array$options
  • ?bool inTemplate Is this being invoked while processing a template?
  • ?bool expandTemplates Should we expand templates encountered here?
  • ?string extTag The name of the extension tag, if any, which is being expanded.

Reimplemented from Wikimedia\Parsoid\Wt2Html\TT\TokenHandler.

Member Function Documentation

◆ onTag()

Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler::onTag ( Token $token)
Parameters
Token$token
Returns
TokenHandlerResult|null

Reimplemented from Wikimedia\Parsoid\Wt2Html\TT\TokenHandler.

◆ processSpecialMagicWord()

Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler::processSpecialMagicWord ( bool $atTopLevel,
TemplateEncapsulator $state,
array $resolvedTgt )

Process the special magic word as specified by $resolvedTgt['magicWordType'].

magicWordType === '!' => {{!}} is the magic word
magicWordtype === 'MASQ' => DEFAULTSORT, DISPLAYTITLE are the magic words
(See Util::magicMasqs())
Parameters
bool$atTopLevel
TemplateEncapsulator$state
array$resolvedTgt
Returns
TemplateExpansionResult

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