See code review at https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/505778/6/src/Wt2Html/PP/Processors/Linter.php#136
if ( $node->nextSibling ) { // TODO: Should this be testing DOMUtils::nextNonSepSibling() instead? return $this->leftMostDescendent( DOMUtils::nextNonSepSibling( $node ), $match ); } return $this->getNextMatchingNode( $node->parentNode, $match );
Quoting @ssastry,
Good question. As it stands, if nextSibling is a separator elt, getNextMatchingNode would return null instead of going up the parent and looking there. Probably an edge case. But, worth fixing later. Maybe file a phab task for this?