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

Native Parsoid implementation of the "json" contentmodel. More...

+ Inheritance diagram for Wikimedia\Parsoid\Ext\JSON\JSON:
+ Collaboration diagram for Wikimedia\Parsoid\Ext\JSON\JSON:

Public Member Functions

 getConfig ()
 Return information about this extension module.FIXME: Add more expected fields or create a class for this FIXME: The 'name' is expected to be the same as the name defined at the top level of extension.json.

Returns
array{name:string}

 
 toDOM (ParsoidExtensionAPI $extApi)
 JSON to HTML.
 
 fromDOM (ParsoidExtensionAPI $extApi, ?SelserData $selserData=null)
 DOM to JSON.
 

Detailed Description

Native Parsoid implementation of the "json" contentmodel.

Member Function Documentation

◆ fromDOM()

Wikimedia\Parsoid\Ext\JSON\JSON::fromDOM ( ParsoidExtensionAPI  $extApi,
?SelserData  $selserData = null 
)

DOM to JSON.

Parameters
ParsoidExtensionAPI$extApi
?SelserData$selserData
Returns
string

Reimplemented from Wikimedia\Parsoid\Core\ContentModelHandler.

◆ getConfig()

Wikimedia\Parsoid\Ext\JSON\JSON::getConfig ( )

Return information about this extension module.FIXME: Add more expected fields or create a class for this FIXME: The 'name' is expected to be the same as the name defined at the top level of extension.json.

Returns
array{name:string}

Implements Wikimedia\Parsoid\Ext\ExtensionModule.

◆ toDOM()

Wikimedia\Parsoid\Ext\JSON\JSON::toDOM ( ParsoidExtensionAPI  $extApi)

JSON to HTML.

Implementation matches that from includes/content/JsonContent.php in mediawiki core, except that we distinguish value types.

Parameters
ParsoidExtensionAPI$extApi
Returns
Document

Reimplemented from Wikimedia\Parsoid\Core\ContentModelHandler.


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