| 1 |
<?php |
| 2 |
declare( strict_types = 1 ); |
| 3 |
|
| 4 |
namespace Wikimedia\Parsoid\Html2Wt\DOMHandlers; |
| 5 |
|
| 6 |
// Just serialize the children, ignore the (implicit) tag |
| 7 |
use Wikimedia\Parsoid\DOM\Element; |
| 8 |
use Wikimedia\Parsoid\DOM\Node; |
| 9 |
use Wikimedia\Parsoid\Html2Wt\SerializerState; |
| 10 |
|
| 11 |
class JustChildrenHandler extends DOMHandler { |
| 12 |
|
| 13 |
public function __construct() { |
| 14 |
parent::__construct( false ); |
| 15 |
} |
| 16 |
|
| 17 |
/** @inheritDoc */ |
| 18 |
public function handle( |
| 19 |
Element $node, SerializerState $state, bool $wrapperUnmodified = false |
| 20 |
): ?Node { |
| 21 |
$state->serializeChildren( $node ); |
| 22 |
return $node->nextSibling; |
| 23 |
} |
| 24 |
|
| 25 |
} |