Parsoid/JS

This page documents Parsoid/JS, which was replaced by Parsoid/PHP in 2020.

Setting up VisualEditor
To set up your own Parsoid service follow the Parsoid installation instructions before setting up VisualEditor. Note that it can be particularly complicated to set up Parsoid and Node.js in non-standard systems, like those running Windows or Debian.

Below is the non-official compatibility matrix between the VisualEditor on some MediaWiki version and the Parsoid service. In general, if you're running into problems with installation, getting exactly matching versions (VisualEditor, Parsoid, and MediaWiki) should be one of the first things you try, even if this table says that a mismatched set will probably work.

Caption :
 * X = tested, working
 * - = tested, non-working

Notes :
 * (a) = non-compatible with 0.6.1 (phabricator:T100681)
 * (b) = non-compatible with 0.9.0 (mailarchive:wikitech-l/2018-March/089690.html); from the version after 0.9.0 (currently unreleased) there is no more compatibility mode
 * (c) = very partially, it is possible to add text but not to modify existing text
 * (d) = issues on images for Parsoid 0.6 + MW 1.30 and probably 1.31 also (Topic:Ufpghq2hidcj3d3w)
 * 0.9 compat = either modified Parsoid code (see this blog) either a specific Parsoid configuration (see this topic)

Linking with Parsoid
To get VisualEditor to talk to Parsoid, add the following code to your  to specify your Parsoid instance:

A single Parsoid server can handle multiple wikis. The Parsoid  setting identifies your wiki configuration to Parsoid. Whether you set  explicitly or optionally accept the default value, the value from   must match the value from Parsoid's. By default it is set to the hostname named by, but you can pick an arbitrary string. Older versions of Parsoid also used a unique "prefix" to identify the server; you may need to list that here as well.

Parsoid must have been configured to match, for example with the following in Parsoid's : If you are using Parsoid older than 0.6.0, you would use a line in Parsoid's  like: Again, the "domain" property is optional in the Parsoid configuration; it defaults to the hostname used in the  property if not specified. The "prefix" property can also be omitted unless you are running a very old version of Parsoid.

See Parsoid/Setup for more details.

Running Parsoid tests
To run all parser tests and mocha tests: The parser tests have quite a few options now which can be listed using.

To run tests on the PHP port:

Converting simple wikitext
You can convert simple wikitext snippets from the command line using the  script in the bin/ directory:

echo 'Foo' | node bin/parse.js

The parse script has a lot of options. gives you information about this.

(In Ubuntu 13 and 14,  has been renamed to  . There, either type   or create a symbolic link or equivalent.)