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

This is a class that wraps the DOMTraverser utility for use in the DOM Post Processor pipeline. More...

+ Inheritance diagram for Wikimedia\Parsoid\Wt2Html\DOMPPTraverser:
+ Collaboration diagram for Wikimedia\Parsoid\Wt2Html\DOMPPTraverser:

Public Member Functions

 __construct (bool $traverseWithTplInfo=false, bool $applyToAttributeEmbeddedHTML=false)
 
 addHandler (?string $nodeName, callable $action)
 
 run (Env $env, Node $workNode, array $options=[], bool $atTopLevel=false)
 
Parameters
Env$env
Element | DocumentFragment$rootThe root of the tree to process
array$options
bool$atTopLevelIs this processor invoked on the top level page? If false, this is being invoked in a sub-pipeline (ex: extensions)

 

Detailed Description

This is a class that wraps the DOMTraverser utility for use in the DOM Post Processor pipeline.

Member Function Documentation

◆ addHandler()

Wikimedia\Parsoid\Wt2Html\DOMPPTraverser::addHandler ( ?string $nodeName,
callable $action )
Parameters
?string$nodeNameAn optional node name filter
callable$actionA callback, called on each node we traverse that matches nodeName. Proxies call to underlying DOMTraverser. See docs for DOMTraverser::addHandler

◆ run()

Wikimedia\Parsoid\Wt2Html\DOMPPTraverser::run ( Env $env,
Node $workNode,
array $options = [],
bool $atTopLevel = false )

Parameters
Env$env
Element | DocumentFragment$rootThe root of the tree to process
array$options
bool$atTopLevelIs this processor invoked on the top level page? If false, this is being invoked in a sub-pipeline (ex: extensions)

Implements Wikimedia\Parsoid\Wt2Html\Wt2HtmlDOMProcessor.


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