summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2021-12-20 20:56:45 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2021-12-20 20:56:45 +0000
commit55b37667550960ec796115f60538998c81268705 (patch)
tree9f2ffae23441578c6434ad8cf7d84c05c0eb38eb
parent4f151b4055c329cdd9bde9ffd6da21fc16ad646e (diff)
parentf33637584665cd248aad7b93a32e61f3ad9944e3 (diff)
Merge "Fix the json schema and the extension processor for Parsoid extension modules"
-rw-r--r--docs/extension.schema.v1.json12
-rw-r--r--docs/extension.schema.v2.json12
-rw-r--r--includes/registration/ExtensionProcessor.php6
3 files changed, 20 insertions, 10 deletions
diff --git a/docs/extension.schema.v1.json b/docs/extension.schema.v1.json
index 922fd59b90e0..b654843870be 100644
--- a/docs/extension.schema.v1.json
+++ b/docs/extension.schema.v1.json
@@ -1132,7 +1132,8 @@
"type": "array",
"description": "The arguments passed to the ExtensionModule constructor or factory"
}
- }
+ },
+ "additionalProperties": false
},
{
"type": "object",
@@ -1159,8 +1160,7 @@
"properties": {
"name": {
"type": "string",
- "description": "The name of the extension tag",
- "required": true
+ "description": "The name of the extension tag"
},
"handler": {
"description": "An object factory specification of a class extending Wikimedia\\Parsoid\\Ext\\ExtensionTagHandler"
@@ -1169,10 +1169,12 @@
"type": "object",
"description": "Additional Parsoid processing configuration for this extension tag"
}
- }
+ },
+ "required": ["name"]
}
}
- }
+ },
+ "additionalProperties": false
}
]
}
diff --git a/docs/extension.schema.v2.json b/docs/extension.schema.v2.json
index ef904027f821..95ca01ded6d5 100644
--- a/docs/extension.schema.v2.json
+++ b/docs/extension.schema.v2.json
@@ -1196,7 +1196,8 @@
"type": "array",
"description": "The arguments passed to the ExtensionModule constructor or factory"
}
- }
+ },
+ "additionalProperties": false
},
{
"type": "object",
@@ -1223,8 +1224,7 @@
"properties": {
"name": {
"type": "string",
- "description": "The name of the extension tag",
- "required": true
+ "description": "The name of the extension tag"
},
"handler": {
"description": "An object factory specification of a class extending Wikimedia\\Parsoid\\Ext\\ExtensionTagHandler"
@@ -1233,10 +1233,12 @@
"type": "object",
"description": "Additional Parsoid processing configuration for this extension tag"
}
- }
+ },
+ "required": ["name"]
}
}
- }
+ },
+ "additionalProperties": false
}
]
}
diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php
index 85be2e642303..2cd718054e18 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -229,6 +229,12 @@ class ExtensionProcessor implements Processor {
// Record the extension name in the ParsoidModules property
if ( isset( $info['ParsoidModules'] ) ) {
foreach ( $info['ParsoidModules'] as &$module ) {
+ if ( is_string( $module ) ) {
+ $className = $module;
+ $module = [
+ 'class' => $className,
+ ];
+ }
$module['name'] = $name;
}
}