Add extension registration mechanism to SiteConfig

This will be called by the ExtensionRegistry in core for extensions
that are Parsoid-compatible.  The set of registered extensions is part
of the SiteConfig, which bundles all the configuration for a particular
Parsoid instance.

In addition, renamed some classes to make things clearer:
`ExtensionModule` is the thing which is registered; it bundles a
number of `ExtensionTagHandler`s, `ContentModelHandler`s, and DOM
processors (which don't have a proper interface yet).  There are a set
of core handlers, which include wikitext, JSON, and a few extension
tags (<pre>, <nowiki>, <gallery>).

Change-Id: Iadbeb378bacb09264a4b1d3ee430a914eec23e48
This commit is contained in:
C. Scott Ananian 2020-04-22 13:10:41 -04:00 committed by Subramanya Sastry
parent 4a46ba9496
commit ded8bd5d74

View file

@ -5,18 +5,18 @@ namespace Wikimedia\Parsoid\Ext\Poem;
use DOMDocument;
use DOMElement;
use Wikimedia\Parsoid\Ext\Extension;
use Wikimedia\Parsoid\Ext\ExtensionTag;
use Wikimedia\Parsoid\Ext\ExtensionModule;
use Wikimedia\Parsoid\Ext\ExtensionTagHandler;
use Wikimedia\Parsoid\Ext\ParsoidExtensionAPI;
use Wikimedia\Parsoid\Utils\DOMCompat;
use Wikimedia\Parsoid\Utils\DOMUtils;
class Poem extends ExtensionTag implements Extension {
class Poem extends ExtensionTagHandler implements ExtensionModule {
/** @inheritDoc */
public function getConfig(): array {
return [
'name' => 'poem',
'name' => 'Poem',
'domProcessors' => [
'wt2htmlPostProcessor' => self::class
],