Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeMutationRelay Class Reference

This is a stage inserted between RemexHtml's TreeBuilder and our DOMBuilder subclass. More...

+ Inheritance diagram for Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeMutationRelay:
+ Collaboration diagram for Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeMutationRelay:

Public Member Functions

 __construct (DOMBuilder $nextHandler)
 
 matchStartTag (Attributes $attribs)
 Start watching for a start tag with the given Attributes object.
 
 matchEndTag (int $sourceLength, bool $isHTML)
 Start watching for an end tag with the given fake source length.
 
 resetMatch ()
 Stop looking for a matching element.
 
 getMatchedElement ()
 If an element was matched, return the element object from the DOM.
 
 insertElement ( $preposition, $ref, Element $element, $void, $sourceStart, $sourceLength)
 Set autoInsertedStart on auto-inserted nodes and forward the event to DOMBuilder.
 

Detailed Description

This is a stage inserted between RemexHtml's TreeBuilder and our DOMBuilder subclass.

Any code that needs to modify the tree mutation event stream should go here. It's currently used for auto-insert detection.

Member Function Documentation

◆ getMatchedElement()

Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeMutationRelay::getMatchedElement ( )

If an element was matched, return the element object from the DOM.

Returns
DOMElement|null A local alias since there are two classes called Element here.

◆ insertElement()

Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeMutationRelay::insertElement ( $preposition,
$ref,
Element $element,
$void,
$sourceStart,
$sourceLength )

Set autoInsertedStart on auto-inserted nodes and forward the event to DOMBuilder.

Parameters
int$preposition
Element | null$ref
Element$element
bool$void
int$sourceStart
int$sourceLength

◆ matchEndTag()

Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeMutationRelay::matchEndTag ( int $sourceLength,
bool $isHTML )

Start watching for an end tag with the given fake source length.

Parameters
int$sourceLength
bool$isHTML$dp->stx=='html', which helps us decide whether to set autoInsertedEnd

The documentation for this class was generated from the following file: