diff --git a/docs/extension.schema.v2.json b/docs/extension.schema.v2.json index cfedeedb377..f84942e0be3 100644 --- a/docs/extension.schema.v2.json +++ b/docs/extension.schema.v2.json @@ -1124,6 +1124,76 @@ } } }, + "ParsoidModules": { + "type": "array", + "description": "List of extension modules to be registered with the Parsoid wikitext parser", + "items": { + "oneOf": [ + { + "type": "string", + "description": "The fully-qualified name of a class implementing Wikimedia\\Parsoid\\Ext\\ExtensionModule" + }, + { + "type": "object", + "description": "An object factory specification for a class implementing Wikimedia\\Parsoid\\Ext\\ExtensionModule", + "properties": { + "factory": { + "type": ["string", "array"], + "description": "A factory function to be called to create an ExtensionModule. This should be omitted if a class is specified." + }, + "class": { + "type": "string", + "description": "The fully-qualified class name of a class implemeting Wikimedia\\Parsoid\\Ext\\ExtensionModule. This should be omitted if a factory is specified." + }, + "args": { + "type": "array", + "description": "The arguments passed to the ExtensionModule constructor or factory" + } + } + }, + { + "type": "object", + "description": "A Parsoid extension module configuration array", + "properties": { + "domProcessors": { + "type": "array", + "items": { + "description": "Object factory specification of a class implementing Wikimedia\\Parsoid\\Ext\\DOMProcessor" + } + }, + "styles": { + "type": "array", + "items": { + "type": "string", + "description": "Additional ResourceLoader styles to include" + } + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "description": "An extension tag", + "properties": { + "name": { + "type": "string", + "description": "The name of the extension tag", + "required": "true" + }, + "handler": { + "description": "An object factory specification of a class extending Wikimedia\\Parsoid\\Ext\\ExtensionTagHandler" + }, + "options": { + "type": "object", + "description": "Additional Parsoid processing configuration for this extension tag" + } + } + } + } + } + } + ] + } + }, "attributes": { "description":"Registration information for other extensions", "type": "object", diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 682dcdace5c..6e67eb31a14 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -63,6 +63,7 @@ class ExtensionProcessor implements Processor { * @var string[] */ protected const CORE_ATTRIBS = [ + 'ParsoidModules', 'RestRoutes', 'SkinOOUIThemes', 'SearchMappings',