Parsoid
A bidirectional parser between wikitext and HTML5
|
Perform post-processing steps on an already-built HTML DOM. More...
Public Member Functions | |||||||
__construct (Env $env, array $options=[], string $stageId="", ?PipelineStage $prevStage=null) | |||||||
getTimeProfile () | |||||||
registerProcessors (array $processors) | |||||||
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.This ensures that all source offsets assigned to tokens and DOM nodes in this stage are relative to the top-level page.
| |||||||
doPostProcess (Node $node) | |||||||
process ( $node, array $opts) | |||||||
Process wikitext, an array of tokens, or a DOM document depending on what pipeline stage this is.This will be entirety of the input that will be processed by this pipeline stage and no further input or an EOF signal will follow.
| |||||||
processChunkily ( $input, array $options) | |||||||
Process wikitext, an array of tokens, or a DOM document depending on what pipeline stage this is.This method will either directly or indirectly implement a generator that parses the input in chunks and yields output in chunks as well.Implementations that don't consume tokens (ex: Tokenizer, DOMPostProcessor) will provide specialized implementations that handle their input type.
| |||||||
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. | |||||||
resetState (array $options) | |||||||
Resets any internal state for this pipeline stage. | |||||||
setFrame (Frame $frame) | |||||||
Set frame on this pipeline stage. | |||||||
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. | |
bool | $toFragment = true |
$frame | |
Perform post-processing steps on an already-built HTML DOM.
Wikimedia\Parsoid\Wt2Html\DOMPostProcessor::process | ( | $node, | |
array | $opts ) |
Process wikitext, an array of tokens, or a DOM document depending on what pipeline stage this is.This will be entirety of the input that will be processed by this pipeline stage and no further input or an EOF signal will follow.
string | array | Document | $input | |
array{sol:bool} | $options
|
Reimplemented from Wikimedia\Parsoid\Wt2Html\PipelineStage.
Wikimedia\Parsoid\Wt2Html\DOMPostProcessor::processChunkily | ( | $input, | |
array | $options ) |
Process wikitext, an array of tokens, or a DOM document depending on what pipeline stage this is.This method will either directly or indirectly implement a generator that parses the input in chunks and yields output in chunks as well.Implementations that don't consume tokens (ex: Tokenizer, DOMPostProcessor) will provide specialized implementations that handle their input type.
string | array | Document | $input | |
array{sol:bool} | $options
|
Reimplemented from Wikimedia\Parsoid\Wt2Html\PipelineStage.
Wikimedia\Parsoid\Wt2Html\DOMPostProcessor::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.This ensures that all source offsets assigned to tokens and DOM nodes in this stage are relative to the top-level page.
SourceRange | $so |
Reimplemented from Wikimedia\Parsoid\Wt2Html\PipelineStage.