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

Static Public Member Functions

static hasNChildren (Node $node, int $nchildren, bool $countDiffMarkers=false)
 Test the number of children this node has without using DOMNode::$childNodes->count().
 
static firstNonSepChild (Node $node)
 Get the first child element or non-IEW text node, ignoring whitespace-only text nodes, comments, and deleted nodes.
 
static nextNonSepSibling (Node $node)
 Get the next non separator sibling node.
 

Member Function Documentation

◆ firstNonSepChild()

static Wikimedia\Parsoid\Ext\DiffDOMUtils::firstNonSepChild ( Node $node)
static

Get the first child element or non-IEW text node, ignoring whitespace-only text nodes, comments, and deleted nodes.

Parameters
Node$node
Returns
Node|null

◆ hasNChildren()

static Wikimedia\Parsoid\Ext\DiffDOMUtils::hasNChildren ( Node $node,
int $nchildren,
bool $countDiffMarkers = false )
static

Test the number of children this node has without using DOMNode::$childNodes->count().

This walks the sibling list and so takes O(nchildren) time – so nchildren is expected to be small (say: 0, 1, or 2).

Skips all diff markers by default.

Parameters
Node$node
int$nchildren
bool$countDiffMarkers
Returns
bool

◆ nextNonSepSibling()

static Wikimedia\Parsoid\Ext\DiffDOMUtils::nextNonSepSibling ( Node $node)
static

Get the next non separator sibling node.

Parameters
Node$node
Returns
Node|null

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