Parsoid/So you want your extension to work with Parsoid

This page aims at gathering information about extension development with Parsoid, in the form of a Frequently Asked Questions (FAQ) list.

What's the point?
To make Parsoid the default MediaWiki wikitext engine, the dependencies to the legacy parser must be removed. This means that the Parser.php class and the parser hooks are bound to be deprecated at some point. To prepare for that, affected extensions should transition to the Parsoid API.

Is my extension affected?
An extension is affected if it either:


 * uses the Parser object
 * has a parser hook.

What do I need to do?
The following steps are documented in further section in this document; this section aims at being a quick checklist for all the necessary steps.


 * Register the extension to Parsoid
 * Create hooks for Parsoid to reproduce the functionality of the existing parser hooks
 * Refactor the code that references Parser to provide a version that uses the Parsoid extension API for the Parsoid hooks
 * Probably: add DomImpl.php stub to Phan
 * Possibly: add a dependency to Parsoid in the CI of the extension

How do I register the extension to Parsoid?
This is documented in detail here: Parsoid/Extension API