Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Html2Wt\DOMHandlers\ListHandler Class Reference
+ Inheritance diagram for Wikimedia\Parsoid\Html2Wt\DOMHandlers\ListHandler:
+ Collaboration diagram for Wikimedia\Parsoid\Html2Wt\DOMHandlers\ListHandler:

Public Member Functions

 __construct (array $firstChildNames)
 
 handle (Element $node, SerializerState $state, bool $wrapperUnmodified=false)
 Serialize a DOM node to wikitext.Serialized wikitext should be returned via $state::emitChunk().

Parameters
Element$node
SerializerState$state
bool$wrapperUnmodified
Returns
Node|null The node to continue with (need not be an element always)

 
 before (Element $node, Node $otherNode, SerializerState $state)
 How many newlines should be emitted before this node?
Parameters
Element$node
Node$otherNode
SerializerState$state
Returns
array

 
 after (Element $node, Node $otherNode, SerializerState $state)
 How many newlines should be emitted after this node?
Parameters
Element$node
Node$otherNode
SerializerState$state
Returns
array

 
- Public Member Functions inherited from Wikimedia\Parsoid\Html2Wt\DOMHandlers\DOMHandler
 __construct (bool $forceSOL=false)
 
 firstChild (Node $node, Node $otherNode, SerializerState $state)
 How many newlines should be emitted before the first child?
 
 lastChild (Node $node, Node $otherNode, SerializerState $state)
 How many newlines should be emitted after the last child?
 
 forceSOL ()
 Put the serializer in start-of-line mode before it is handled.
 

Public Attributes

 $firstChildNames
 

Additional Inherited Members

- Protected Member Functions inherited from Wikimedia\Parsoid\Html2Wt\DOMHandlers\DOMHandler
 getListBullets (SerializerState $state, Element $node)
 List helper: DOM-based list bullet construction.
 
 maxNLsInTable (Node $node, Node $origNode)
 Helper: Newline constraint helper for table nodes.
 
 serializeTableTag (string $symbol, ?string $endSymbol, SerializerState $state, Element $node, bool $wrapperUnmodified)
 Helper: Handles content serialization for table nodes.
 
 stxInfoValidForTableCell (SerializerState $state, Element $node)
 Helper: Checks whether syntax information in data-parsoid is valid in the presence of table edits.
 
 getLeadingSpace (SerializerState $state, Element $node, string $newEltDefault)
 Helper for several DOM handlers: Returns whitespace that needs to be emitted between the markup for the node and its content (ex: table cells, list items) based on node state (whether the node is original or new content) and other state (HTML version, whether selective serialization is enabled or not).
 
 getTrailingSpace (SerializerState $state, Element $node, string $newEltDefault)
 Helper for several DOM handlers: Returns whitespace that needs to be emitted between the markup for the node and its next sibling based on node state (whether the node is original or new content) and other state (HTML version, whether selective serialization is enabled or not).
 
 emitPlaceholderSrc (Element $node, SerializerState $state)
 Uneditable forms wrapped with mw:Placeholder tags OR unedited nowikis N.B.
 

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Html2Wt\DOMHandlers\ListHandler::__construct ( array $firstChildNames)
Parameters
string[]$firstChildNamesList of tag names which van be first children of the list

Member Function Documentation

◆ after()

Wikimedia\Parsoid\Html2Wt\DOMHandlers\ListHandler::after ( Element $node,
Node $otherNode,
SerializerState $state )

How many newlines should be emitted after this node?

Parameters
Element$node
Node$otherNode
SerializerState$state
Returns
array

Reimplemented from Wikimedia\Parsoid\Html2Wt\DOMHandlers\DOMHandler.

◆ before()

Wikimedia\Parsoid\Html2Wt\DOMHandlers\ListHandler::before ( Element $node,
Node $otherNode,
SerializerState $state )

How many newlines should be emitted before this node?

Parameters
Element$node
Node$otherNode
SerializerState$state
Returns
array

Reimplemented from Wikimedia\Parsoid\Html2Wt\DOMHandlers\DOMHandler.

◆ handle()

Wikimedia\Parsoid\Html2Wt\DOMHandlers\ListHandler::handle ( Element $node,
SerializerState $state,
bool $wrapperUnmodified = false )

Serialize a DOM node to wikitext.Serialized wikitext should be returned via $state::emitChunk().

Parameters
Element$node
SerializerState$state
bool$wrapperUnmodified
Returns
Node|null The node to continue with (need not be an element always)

Reimplemented from Wikimedia\Parsoid\Html2Wt\DOMHandlers\DOMHandler.


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