Debian Codegraph @

vendor/wikimedia/parsoid/src/Html2Wt/DOMHandlers/HTMLPreHandler.php

raw
1 <?php
2 declare( strict_types = 1 );
3
4 namespace Wikimedia\Parsoid\Html2Wt\DOMHandlers;
5
6 use Wikimedia\Parsoid\DOM\Element;
7 use Wikimedia\Parsoid\DOM\Node;
8 use Wikimedia\Parsoid\Html2Wt\SerializerState;
9
10 class HTMLPreHandler extends DOMHandler {
11
12 public function __construct() {
13 parent::__construct( false );
14 }
15
16 /** @inheritDoc */
17 public function handle(
18 Element $node, SerializerState $state, bool $wrapperUnmodified = false
19 ): ?Node {
20 ( new FallbackHTMLHandler )->handle( $node, $state, $wrapperUnmodified );
21 return $node->nextSibling;
22 }
23
24 /** @inheritDoc */
25 public function firstChild( Node $node, Node $otherNode, SerializerState $state ): array {
26 return [ 'max' => PHP_INT_MAX ];
27 }
28
29 /** @inheritDoc */
30 public function lastChild( Node $node, Node $otherNode, SerializerState $state ): array {
31 return [ 'max' => PHP_INT_MAX ];
32 }
33
34 }