Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Tokens\CompoundTk Class Reference

Compound token representing lists, tables, etc. More...

+ Inheritance diagram for Wikimedia\Parsoid\Tokens\CompoundTk:
+ Collaboration diagram for Wikimedia\Parsoid\Tokens\CompoundTk:

Public Member Functions

 __construct (array $nestedToks=[], ?DataParsoid $dp=null)
 
 __clone ()
 
 addToken ( $token)
 
 addTokens (array $tokens)
 
 getNestedTokens ()
 
 setNestedTokens (array $tokens)
 
 setsEOLContext ()
 Does this token implicitly induce an end-of-line context? This is true for tokens that are only generated on seeing EOL & EOF (ex: IndentPreTk, ListTk)
 
 jsonSerialize ()
 
- Public Member Functions inherited from Wikimedia\Parsoid\Tokens\Token
 toJsonArray ()
 
 getType ()
 Returns a string key for this token.
 
 addAttribute (string $name, $value, ?KVSourceRange $srcOffsets=null)
 Generic set attribute method.
 
 addNormalizedAttribute (string $name, $value, $origValue)
 Generic set attribute method with support for change detection.
 
 getAttributeV (string $name)
 Generic attribute accessor.
 
 getAttributeKV (string $name)
 Generic attribute accessor.
 
 hasAttribute (string $name)
 Generic attribute accessor.
 
 setAttribute (string $name, $value)
 Set an unshadowed attribute.
 
 setShadowInfo (string $name, $value, $origValue)
 Store the original value of an attribute in a token's dataParsoid.
 
 setShadowInfoIfModified (string $name, $value, $origValue)
 Store the original value of an attribute in a token's dataParsoid.
 
 getAttributeShadowInfo (string $name)
 Attribute info accessor for the wikitext serializer.
 
 removeAttribute (string $name)
 Completely remove all attributes with this name.
 
 addSpaceSeparatedAttribute (string $name, string $value)
 Add a space-separated property value.
 
 getWTSource (Source ... $source)
 Get the wikitext source of a token.
 
 fetchExpandedAttrValue (string $key)
 

Protected Attributes

array $nestedTokens
 

Additional Inherited Members

- Static Public Member Functions inherited from Wikimedia\Parsoid\Tokens\Token
static jsonClassHintFor (string $keyName)
 
static newFromJsonArray (array $json)
 
static hint ()
 
static getToken ( $input)
 Get a token from some PHP structure.
 
- Public Attributes inherited from Wikimedia\Parsoid\Tokens\Token
DataParsoid $dataParsoid
 
DataMw $dataMw = null
 
array $attribs = null
 
- Protected Member Functions inherited from Wikimedia\Parsoid\Tokens\Token
 __construct (?DataParsoid $dataParsoid, ?DataMw $dataMw)
 

Detailed Description

Compound token representing lists, tables, etc.

The actual tokens representing the list are stored as a token array in this token.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Tokens\CompoundTk::__construct ( array $nestedToks = [],
?DataParsoid $dp = null )
Parameters
array<string|Token>$nestedToks
?DataParsoid$dp

Member Function Documentation

◆ __clone()

Wikimedia\Parsoid\Tokens\CompoundTk::__clone ( )

Reimplemented from Wikimedia\Parsoid\Tokens\Token.

◆ addToken()

Wikimedia\Parsoid\Tokens\CompoundTk::addToken ( $token)
Parameters
string | Token$token

◆ addTokens()

Wikimedia\Parsoid\Tokens\CompoundTk::addTokens ( array $tokens)
Parameters
array<string|Token>$tokens

◆ getNestedTokens()

Wikimedia\Parsoid\Tokens\CompoundTk::getNestedTokens ( )
Returns
array<string|Token>

◆ jsonSerialize()

Wikimedia\Parsoid\Tokens\CompoundTk::jsonSerialize ( )

Reimplemented from Wikimedia\Parsoid\Tokens\Token.

Reimplemented in Wikimedia\Parsoid\Tokens\ListTk.

◆ setsEOLContext()

Wikimedia\Parsoid\Tokens\CompoundTk::setsEOLContext ( )
abstract

Does this token implicitly induce an end-of-line context? This is true for tokens that are only generated on seeing EOL & EOF (ex: IndentPreTk, ListTk)

Reimplemented in Wikimedia\Parsoid\Tokens\EmptyLineTk, Wikimedia\Parsoid\Tokens\IndentPreTk, and Wikimedia\Parsoid\Tokens\ListTk.


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