Parsoid
A bidirectional parser between wikitext and HTML5
Parsoid Namespace Reference

This is a demonstration of content model handling in extensions for Parsoid. More...

Namespaces

 Html2Wt
 Serializes language variant markup, like `-{ ...
 
 Language
 A bidirectional Language Converter, capable of round-tripping variant conversion.
 
 Utils
 This file contains general utilities for: (a) querying token properties and token types (b) manipulating tokens, individually and as collections.
 
 Wt2Html
 Front-end/Wrapper for a particular tree builder, in this case the parser/tree builder from RemexHtml.
 

Classes

class  ClientError
 Exception thrown on invalid client requests. More...
 
class  ContentModelHandler
 
class  DataParsoid
 Parsoid data for a DOM node. More...
 
class  InternalException
 Parsoid internal error that we don't know how to recover from. More...
 
class  PageBundle
 PORT-FIXME: This is just a placeholder for data that was previously passed to entrypoint in JavaScript. More...
 
class  Parsoid
 
class  ResourceLimitExceededException
 Parsoid resource limit exception. More...
 
class  SelserData
 Data that's necessary for selective serialization, to be passed to the library entrypoint. More...
 
class  WikitextContentModelHandler
 

Variables

 $ParsoidExtApi = $module->parent->require( './extapi.js' )->versionCheck( '^0.10.0' )
 
 $temp0
 
 $DOMDataUtils = $temp0::DOMDataUtils
 
 $DOMUtils
 
 $Promise
 
 $addMetaData
 
 $JSONExt
 
 $PARSE_ERROR_HTML
 
 $Util = require './Util.js'::Util
 
 $Diff = []
 
 $diffTokens
 

Detailed Description

This is a demonstration of content model handling in extensions for Parsoid.

Diff tools.

It implements the "json" content model, to allow editing JSON data structures using Visual Editor. It represents the JSON structure as a nested table. ext/JSON

Variable Documentation

◆ $addMetaData

Parsoid\$addMetaData
Initial value:
= $temp0->
addMetaData

◆ $diffTokens

Parsoid\$diffTokens
Initial value:
= function ( $oldString, $newString, $tokenize ) use ( &$simpleDiff ) {
if ( $oldString === $newString ) {
return [ [ '=', [ $newString ] ] ];
} else {
return simpleDiff::diff( $tokenize( $oldString ), $tokenize( $newString ) );
}
}

◆ $DOMUtils

Parsoid\$DOMUtils
Initial value:
= $temp0::
DOMUtils

◆ $JSONExt

Parsoid\$JSONExt
Initial value:
= function () {
$this->config = [
'contentmodels' => [
'json' => $this
]
];
}

◆ $PARSE_ERROR_HTML

Parsoid\$PARSE_ERROR_HTML
Initial value:
=
'<!DOCTYPE html><html>'
. '<body>'
. "<table data-mw='{\"errors\":[{\"key\":\"bad-json\"}]}' typeof=\"mw:Error\">"
. '</body>'

◆ $Promise

Parsoid\$Promise
Initial value:
= $temp0::
Promise

◆ $temp0

Parsoid\$temp0
Initial value:
=
$ParsoidExtApi