Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
WrapTemplates | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
run | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace Wikimedia\Parsoid\Wt2Html\DOM\Processors; |
5 | |
6 | use Wikimedia\Parsoid\Config\Env; |
7 | use Wikimedia\Parsoid\DOM\Node; |
8 | use Wikimedia\Parsoid\Wt2Html\Wt2HtmlDOMProcessor; |
9 | |
10 | class WrapTemplates implements Wt2HtmlDOMProcessor { |
11 | /** |
12 | * Encapsulate template-affected DOM structures by wrapping text nodes into |
13 | * spans and adding RDFa attributes to all subtree roots according to |
14 | * http://www.mediawiki.org/wiki/Parsoid/RDFa_vocabulary#Template_content |
15 | * @inheritDoc |
16 | */ |
17 | public function run( |
18 | Env $env, Node $root, array $options = [], bool $atTopLevel = false |
19 | ): void { |
20 | // Don't run this in template content |
21 | if ( $options['inTemplate'] ) { |
22 | return; |
23 | } |
24 | |
25 | $op = new DOMRangeBuilder( $root->ownerDocument, $options['frame'] ); |
26 | $op->execute( $root ); |
27 | } |
28 | } |