MediaWiki
1.34.0
|
Public Member Functions | |
__construct (Serializer $serializer, $trace=false) | |
characters ( $preposition, $refElement, $text, $start, $length, $sourceStart, $sourceLength) | |
comment ( $preposition, $refElement, $text, $sourceStart, $sourceLength) | |
doctype ( $name, $public, $system, $quirks, $sourceStart, $sourceLength) | |
endDocument ( $pos) | |
endTag (Element $element, $sourceStart, $sourceLength) | |
error ( $text, $pos) | |
insertElement ( $preposition, $refElement, Element $element, $void, $sourceStart, $sourceLength) | |
Insert or reparent an element. More... | |
mergeAttributes (Element $element, Attributes $attrs, $sourceStart) | |
removeNode (Element $element, $sourceStart) | |
reparentChildren (Element $element, Element $newParent, $sourceStart) | |
startDocument ( $fragmentNamespace, $fragmentName) | |
Private Member Functions | |
disablePWrapper (SerializerNode $node, $sourceStart) | |
Find the ancestor of $node which is a child of a p-wrapper, and reparent that node so that it is placed after the end of the p-wrapper. More... | |
getParentForInsert ( $preposition, $refElement) | |
insertPWrapper (SerializerNode $parent, $sourceStart) | |
Insert a p-wrapper. More... | |
splitTagStack (SerializerNode $parentNode, $inline, $pos) | |
Clone nodes in a stack range and return the new parent. More... | |
trace ( $msg) | |
Private Attributes | |
Serializer | $serializer |
bool | $trace |
Static Private Attributes | |
static | $formattingElements |
static array | $metadataElements |
For the purposes of this class, "metadata" elements are those that should neither trigger p-wrapping nor stop an outer p-wrapping, typically those that are themselves invisible in a browser's rendering. More... | |
static | $onlyInlineElements |
Definition at line 17 of file RemexCompatMunger.php.
MediaWiki\Tidy\RemexCompatMunger::__construct | ( | Serializer | $serializer, |
$trace = false |
|||
) |
Serializer | $serializer | |
bool | $trace |
Definition at line 117 of file RemexCompatMunger.php.
References MediaWiki\Tidy\RemexCompatMunger\$serializer, MediaWiki\Tidy\RemexCompatMunger\$trace, and MediaWiki\Tidy\RemexCompatMunger\trace().
MediaWiki\Tidy\RemexCompatMunger::characters | ( | $preposition, | |
$refElement, | |||
$text, | |||
$start, | |||
$length, | |||
$sourceStart, | |||
$sourceLength | |||
) |
Definition at line 179 of file RemexCompatMunger.php.
References MediaWiki\Tidy\RemexCompatMunger\getParentForInsert(), MediaWiki\Tidy\RemexCompatMunger\insertPWrapper(), and MediaWiki\Tidy\RemexCompatMunger\splitTagStack().
MediaWiki\Tidy\RemexCompatMunger::comment | ( | $preposition, | |
$refElement, | |||
$text, | |||
$sourceStart, | |||
$sourceLength | |||
) |
Definition at line 484 of file RemexCompatMunger.php.
References MediaWiki\Tidy\RemexCompatMunger\getParentForInsert().
|
private |
Find the ancestor of $node which is a child of a p-wrapper, and reparent that node so that it is placed after the end of the p-wrapper.
Definition at line 438 of file RemexCompatMunger.php.
Referenced by MediaWiki\Tidy\RemexCompatMunger\insertElement().
MediaWiki\Tidy\RemexCompatMunger::doctype | ( | $name, | |
$public, | |||
$system, | |||
$quirks, | |||
$sourceStart, | |||
$sourceLength | |||
) |
Definition at line 479 of file RemexCompatMunger.php.
MediaWiki\Tidy\RemexCompatMunger::endDocument | ( | $pos | ) |
Definition at line 129 of file RemexCompatMunger.php.
MediaWiki\Tidy\RemexCompatMunger::endTag | ( | Element | $element, |
$sourceStart, | |||
$sourceLength | |||
) |
Definition at line 469 of file RemexCompatMunger.php.
MediaWiki\Tidy\RemexCompatMunger::error | ( | $text, | |
$pos | |||
) |
Definition at line 489 of file RemexCompatMunger.php.
|
private |
Definition at line 133 of file RemexCompatMunger.php.
Referenced by MediaWiki\Tidy\RemexCompatMunger\characters(), MediaWiki\Tidy\RemexCompatMunger\comment(), and MediaWiki\Tidy\RemexCompatMunger\insertElement().
MediaWiki\Tidy\RemexCompatMunger::insertElement | ( | $preposition, | |
$refElement, | |||
Element | $element, | ||
$void, | |||
$sourceStart, | |||
$sourceLength | |||
) |
Insert or reparent an element.
Create p-wrappers or split the tag stack as necessary.
Consider the following insertion locations. The parent may be:
And consider that we may insert two types of element:
We handle the insertion as follows:
FIXME: fostering ($preposition == BEFORE) is mostly done by inserting as normal, the full algorithm is not followed.
int | $preposition | |
Element | SerializerNode | null | $refElement | |
Element | $element | |
bool | $void | |
int | $sourceStart | |
int | $sourceLength |
Definition at line 268 of file RemexCompatMunger.php.
References MediaWiki\Tidy\RemexCompatMunger\disablePWrapper(), MediaWiki\Tidy\RemexCompatMunger\getParentForInsert(), MediaWiki\Tidy\RemexCompatMunger\insertPWrapper(), MediaWiki\Tidy\RemexCompatMunger\splitTagStack(), and MediaWiki\Tidy\RemexCompatMunger\trace().
Referenced by MediaWiki\Tidy\RemexCompatMunger\reparentChildren().
|
private |
Insert a p-wrapper.
SerializerNode | $parent | |
int | $sourceStart |
Definition at line 167 of file RemexCompatMunger.php.
Referenced by MediaWiki\Tidy\RemexCompatMunger\characters(), MediaWiki\Tidy\RemexCompatMunger\insertElement(), and MediaWiki\Tidy\RemexCompatMunger\splitTagStack().
MediaWiki\Tidy\RemexCompatMunger::mergeAttributes | ( | Element | $element, |
Attributes | $attrs, | ||
$sourceStart | |||
) |
Definition at line 493 of file RemexCompatMunger.php.
MediaWiki\Tidy\RemexCompatMunger::removeNode | ( | Element | $element, |
$sourceStart | |||
) |
Definition at line 497 of file RemexCompatMunger.php.
MediaWiki\Tidy\RemexCompatMunger::reparentChildren | ( | Element | $element, |
Element | $newParent, | ||
$sourceStart | |||
) |
Definition at line 501 of file RemexCompatMunger.php.
References $self, MediaWiki\Tidy\RemexCompatMunger\insertElement(), and MediaWiki\Tidy\RemexCompatMunger\trace().
|
private |
Clone nodes in a stack range and return the new parent.
SerializerNode | $parentNode | |
bool | $inline | |
int | $pos | The source position |
Definition at line 364 of file RemexCompatMunger.php.
References MediaWiki\Tidy\RemexCompatMunger\$serializer, and MediaWiki\Tidy\RemexCompatMunger\insertPWrapper().
Referenced by MediaWiki\Tidy\RemexCompatMunger\characters(), and MediaWiki\Tidy\RemexCompatMunger\insertElement().
MediaWiki\Tidy\RemexCompatMunger::startDocument | ( | $fragmentNamespace, | |
$fragmentName | |||
) |
Definition at line 122 of file RemexCompatMunger.php.
|
private |
Definition at line 209 of file RemexCompatMunger.php.
References wfDebug().
Referenced by MediaWiki\Tidy\RemexCompatMunger\__construct(), MediaWiki\Tidy\RemexCompatMunger\insertElement(), and MediaWiki\Tidy\RemexCompatMunger\reparentChildren().
|
staticprivate |
Definition at line 90 of file RemexCompatMunger.php.
|
staticprivate |
For the purposes of this class, "metadata" elements are those that should neither trigger p-wrapping nor stop an outer p-wrapping, typically those that are themselves invisible in a browser's rendering.
This isn't a complete list, it's just the tags that we're likely to encounter in practice.
Definition at line 83 of file RemexCompatMunger.php.
|
staticprivate |
Definition at line 18 of file RemexCompatMunger.php.
|
private |
Definition at line 108 of file RemexCompatMunger.php.
Referenced by MediaWiki\Tidy\RemexCompatMunger\__construct(), and MediaWiki\Tidy\RemexCompatMunger\splitTagStack().
|
private |
Definition at line 111 of file RemexCompatMunger.php.
Referenced by MediaWiki\Tidy\RemexCompatMunger\__construct().