MediaWiki REL1_31
RemexMungerData.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Tidy;
4
17
25
35
46
52 public $isPWrapper = false;
53
61 public $isSplittable = false;
62
67 public $needsPWrapping = false;
68
74
75 public function __set( $name, $value ) {
76 throw new \Exception( "Cannot set property \"$name\"" );
77 }
78
85 public function dump() {
86 if ( $this->childPElement ) {
87 $parts[] = 'childPElement=' . $this->childPElement->getDebugTag();
88 }
89 if ( $this->ancestorPNode ) {
90 $parts[] = "ancestorPNode=<{$this->ancestorPNode->name}>";
91 }
92 if ( $this->wrapBaseNode ) {
93 $parts[] = "wrapBaseNode=<{$this->wrapBaseNode->name}>";
94 }
95 if ( $this->currentCloneElement ) {
96 $parts[] = "currentCloneElement=" . $this->currentCloneElement->getDebugTag();
97 }
98 if ( $this->isPWrapper ) {
99 $parts[] = 'isPWrapper';
100 }
101 if ( $this->isSplittable ) {
102 $parts[] = 'isSplittable';
103 }
104 if ( $this->needsPWrapping ) {
105 $parts[] = 'needsPWrapping';
106 }
107 if ( $this->nonblankNodeCount ) {
108 $parts[] = "nonblankNodeCount={$this->nonblankNodeCount}";
109 }
110 $s = "RemexMungerData {\n";
111 foreach ( $parts as $part ) {
112 $s .= " $part\n";
113 }
114 $s .= "}\n";
115 return $s;
116 }
117}
bool $isSplittable
Is the node splittable, i.e.
RemexHtml Serializer SerializerNode null $ancestorPNode
This tracks the mw:p-wrap node in the Serializer stack which is an ancestor of this node.
RemexHtml TreeBuilder Element null $currentCloneElement
Stack splitting (essentially our idea of AFE reconstruction) can clone formatting elements which are ...
$nonblankNodeCount
The number of child nodes, not counting whitespace-only text nodes or comments.
RemexHtml Serializer SerializerNode null $wrapBaseNode
The wrap base node is the body or blockquote node which is the parent of active p-wrappers.
bool $isPWrapper
Is the node a p-wrapper, with name mw:p-wrap?
RemexHtml TreeBuilder Element null $childPElement
The Element for the mw:p-wrap which is a child of the current node.
$needsPWrapping
This is true if the node is a body or blockquote, which activates p-wrapping of child nodes.
dump()
Get a text representation of the current state of the serializer, for debugging.