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

Static Public Member Functions

static stripMarkerMetas (Element $node, Env $env)
 
static handleEmptyElements (Node $node, Env $env, DTState $state)
 
static cleanupAndSaveDataParsoid (array $usedIdIndex, Node $node, Env $env, DTState $state)
 Perform some final cleanup and save data-parsoid attributes on each node.
 

Member Function Documentation

◆ cleanupAndSaveDataParsoid()

static Wikimedia\Parsoid\Wt2Html\PP\Handlers\CleanUp::cleanupAndSaveDataParsoid ( array $usedIdIndex,
Node $node,
Env $env,
DTState $state )
static

Perform some final cleanup and save data-parsoid attributes on each node.

Parameters
array$usedIdIndex
Node$node
Env$env
DTState$state
Returns
bool|Node The next node or true to continue with $node->nextSibling

◆ handleEmptyElements()

static Wikimedia\Parsoid\Wt2Html\PP\Handlers\CleanUp::handleEmptyElements ( Node $node,
Env $env,
DTState $state )
static
Parameters
Node$node
Env$env
DTState$state
Returns
bool|Node

The node is known to be empty and a deletion candidate

  • If node is part of template content, it can be deleted (since we know it has no attributes, it won't be the first node that has about, typeof, and other attrs)
  • If not, we add the mw-empty-elt class so that wikis can decide what to do with them.

◆ stripMarkerMetas()

static Wikimedia\Parsoid\Wt2Html\PP\Handlers\CleanUp::stripMarkerMetas ( Element $node,
Env $env )
static
Parameters
Element$node
Env$env
Returns
bool|Element

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