Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeBuilderStage Class Reference
+ Inheritance diagram for Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeBuilderStage:
+ Collaboration diagram for Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeBuilderStage:

Public Member Functions

 __construct (Env $env, array $options=[], string $stageId="", ?PipelineStage $prevStage=null)
 
 resetState (array $options)
 Resets any internal state for this pipeline stage.This is usually called so a cached pipeline can be reused.
Parameters
array$options

 
 processChunk (array $tokens)
 Process a chunk of tokens and feed it to the HTML5 tree builder.
 
 finalizeDOM ()
 
 processToken ( $token)
 Adapt the token format to internal HTML tree builder format, call the actual html tree builder by emitting the token.
 
 process ( $input, array $opts=null)
 
 processChunkily ( $input, array $opts=null)
 
- Public Member Functions inherited from Wikimedia\Parsoid\Wt2Html\PipelineStage
 __construct (Env $env, ?PipelineStage $prevStage=null)
 
 setPipelineId (int $id)
 
 getPipelineId ()
 
 getEnv ()
 
 addTransformer (TokenHandler $t)
 Register a token transformer.
 
 setFrame (Frame $frame)
 Set frame on this pipeline stage.
 
 setSourceOffsets (SourceRange $so)
 Set the source offsets for the content being processing by this pipeline This matters for when a substring of the top-level page is being processed in its own pipeline.
 
 process ( $input, ?array $options=null)
 Process wikitext, an array of tokens, or a DOM document depending on what pipeline stage this is.
 
 processChunkily ( $input, ?array $options)
 Process wikitext, an array of tokens, or a DOM document depending on what pipeline stage this is.
 

Additional Inherited Members

- Protected Attributes inherited from Wikimedia\Parsoid\Wt2Html\PipelineStage
 $prevStage
 
 $pipelineId = -1
 
 $env = null
 
bool $atTopLevel = false
 Defaults to false and resetState initializes it.
 
 $frame
 

Member Function Documentation

◆ processChunk()

Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeBuilderStage::processChunk ( array $tokens)

Process a chunk of tokens and feed it to the HTML5 tree builder.

This doesn't return anything.

Parameters
array$tokensArray of tokens to process

◆ processToken()

Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeBuilderStage::processToken ( $token)

Adapt the token format to internal HTML tree builder format, call the actual html tree builder by emitting the token.

Parameters
Token | string$token

◆ resetState()

Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeBuilderStage::resetState ( array $options)

Resets any internal state for this pipeline stage.This is usually called so a cached pipeline can be reused.

Parameters
array$options

Reimplemented from Wikimedia\Parsoid\Wt2Html\PipelineStage.


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