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

Public Member Functions

 run (Env $env, Node $root, array $options=[], bool $atTopLevel=false)
 Wrap children of <body> as well as children of

found anywhere in the DOM tree.


 

Static Public Member Functions

static pWrapOptional (Node $n)
 Is a P-wrapper optional for this node?
 

Member Function Documentation

◆ pWrapOptional()

static Wikimedia\Parsoid\Wt2Html\DOM\Processors\PWrap::pWrapOptional ( Node $n)
static

Is a P-wrapper optional for this node?

The following nodes do not need p wrappers of their own:

  • whitespace nodes
  • comment nodes
  • HTML metadata tags generated by wikitext (not always rendering-transparent) and these metatags don't need p-wrappers of their own. Both Remex and Parsoid have identical p-wrapping behavior on these tags. This is a superset of \MediaWiki\Tidy\RemexCompatMunger::$metadataElements.
  • parsoid-added span wrappers around pwrap-optional nodes
Parameters
Node$n
Returns
bool

◆ run()

Wikimedia\Parsoid\Wt2Html\DOM\Processors\PWrap::run ( Env $env,
Node $root,
array $options = [],
bool $atTopLevel = false )

Wrap children of <body> as well as children of

found anywhere in the DOM tree.

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: