Add 'ParsoidModules' as a top-level core attribute in extension.json

See also I20f641a1ff032a6da3549b01dfaf8f4cf1eb5071, which uses this
attribute, and the earlier discussion in the (abandoned)
Ia251d631febf5be7fcad21cd8b73a68ec2785137.

Bug: T133320
Change-Id: I6c74938883376ec17f3790678b435585083a440f
This commit is contained in:
C. Scott Ananian 2020-05-20 17:59:38 -04:00 committed by C. Scott Ananian
parent b04b606bcf
commit e71e025aba
2 changed files with 71 additions and 0 deletions

View file

@ -1021,6 +1021,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",

View file

@ -63,6 +63,7 @@ class ExtensionProcessor implements Processor {
* @var string[]
*/
protected const CORE_ATTRIBS = [
'ParsoidModules',
'RestRoutes',
'SkinOOUIThemes',
'SearchMappings',