Parsoid
A bidirectional parser between wikitext and HTML5
Wikimedia\Parsoid\Ext\DOMProcessor Class Reference

A Parsoid extension module may contain one or more DOMProcessors, which allow Parsoid to post-process the DOM in the wt2html direction, or pre-process the DOM in the html2wt direction. More...

+ Inheritance diagram for Wikimedia\Parsoid\Ext\DOMProcessor:

Public Member Functions

 wtPostprocess (ParsoidExtensionAPI $extApi, Node $root, array $options, bool $atTopLevel)
 Post-process DOM in the wt2html direction. More...
 
 htmlPreprocess (ParsoidExtensionAPI $extApi, Element $root)
 Pre-process DOM in the html2wt direction. More...
 

Detailed Description

A Parsoid extension module may contain one or more DOMProcessors, which allow Parsoid to post-process the DOM in the wt2html direction, or pre-process the DOM in the html2wt direction.

Member Function Documentation

◆ htmlPreprocess()

Wikimedia\Parsoid\Ext\DOMProcessor::htmlPreprocess ( ParsoidExtensionAPI  $extApi,
Element  $root 
)

Pre-process DOM in the html2wt direction.

Parameters
ParsoidExtensionAPI$extApi
Element$root

Reimplemented in Wikimedia\Parsoid\Ext\Cite\RefProcessor.

◆ wtPostprocess()

Wikimedia\Parsoid\Ext\DOMProcessor::wtPostprocess ( ParsoidExtensionAPI  $extApi,
Node  $root,
array  $options,
bool  $atTopLevel 
)

Post-process DOM in the wt2html direction.

Parameters
ParsoidExtensionAPI$extApi
DocumentFragment | Element$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)

Reimplemented in Wikimedia\Parsoid\ParserTests\ParserHookProcessor, Wikimedia\Parsoid\Ext\Poem\PoemProcessor, and Wikimedia\Parsoid\Ext\Cite\RefProcessor.


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