Page MenuHomePhorge

No OneTemporary

Size
4 KB
Referenced Files
None
Subscribers
None
diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php
index 9f26083431f..78a3952cdbe 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -307,7 +307,7 @@ class ExtensionProcessor implements Processor {
'class' => $className,
];
}
- $module['name'] = $name;
+ $module['name'] ??= $name;
}
}
diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php
index ab1851b9479..5b0ba258ffa 100644
--- a/includes/specials/SpecialVersion.php
+++ b/includes/specials/SpecialVersion.php
@@ -934,23 +934,60 @@ class SpecialVersion extends SpecialPage {
array_walk( $funcHooks, static function ( &$value ) use ( $preferredSynonyms ) {
$value = $preferredSynonyms[$value];
} );
+ $legacyHooks = array_flip( $funcHooks );
// Sort case-insensitively, ignoring the leading '#' if present
- usort( $funcHooks, static function ( $a, $b ) {
+ $cmpHooks = static function ( $a, $b ) {
return strcasecmp( ltrim( $a, '#' ), ltrim( $b, '#' ) );
- } );
+ };
+ usort( $funcHooks, $cmpHooks );
- array_walk( $funcHooks, static function ( &$value ) {
+ $formatHooks = static function ( &$value ) {
// Bidirectional isolation ensures it displays as {{#ns}} and not {{ns#}} in RTL wikis
$value = Html::rawElement(
'bdi',
[],
Html::element( 'code', [], '{{' . $value . '}}' )
);
- } );
+ };
+ array_walk( $funcHooks, $formatHooks );
$out .= $this->getLanguage()->listToText( $funcHooks );
+ # Get a list of parser functions from Parsoid as well.
+ $parsoidHooks = [];
+ $services = MediaWikiServices::getInstance();
+ $siteConfig = $services->getParsoidSiteConfig();
+ $magicWordFactory = $services->getMagicWordFactory();
+ foreach ( $siteConfig->getPFragmentHandlerKeys() as $key ) {
+ $config = $siteConfig->getPFragmentHandlerConfig( $key );
+ if ( !( $config['options']['parserFunction'] ?? false ) ) {
+ continue;
+ }
+ $mw = $magicWordFactory->get( $key );
+ foreach ( $mw->getSynonyms() as $local ) {
+ if ( !( $config['options']['nohash'] ?? false ) ) {
+ $local = '#' . $local;
+ }
+ // Skip hooks already present in legacy hooks (they will
+ // also work in parsoid)
+ if ( isset( $legacyHooks[$local] ) ) {
+ continue;
+ }
+ $parsoidHooks[] = $local;
+ }
+ }
+ if ( $parsoidHooks ) {
+ $out .= Html::element(
+ 'h3',
+ [ 'id' => 'mw-version-parser-function-hooks-parsoid' ],
+ $this->msg( 'version-parser-function-hooks-parsoid' )->text()
+ );
+ usort( $parsoidHooks, $cmpHooks );
+ array_walk( $parsoidHooks, $formatHooks );
+ $out .= $this->getLanguage()->listToText( $parsoidHooks );
+ }
+
return $out;
}
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 0a7c77479b8..322f3d4dd8a 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -3568,6 +3568,7 @@
"version-hooks": "Hooks",
"version-parser-extensiontags": "Parser extension tags",
"version-parser-function-hooks": "Parser function hooks",
+ "version-parser-function-hooks-parsoid": "Parsoid-only",
"version-parsoid-modules": "Parsoid extension modules",
"version-hook-name": "Hook name",
"version-hook-subscribedby": "Subscribed by",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 7db64a1c97f..385b09bbd45 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -3837,6 +3837,7 @@
"version-hooks": "Shown in [[Special:Version]]\n{{Identical|Hook}}",
"version-parser-extensiontags": "Part of [[Special:Version]].\nThis message is followed by the list of parser extension tags like <code><nowiki><charinsert></nowiki></code>, <code><nowiki><coordinates></nowiki></code>, etc.",
"version-parser-function-hooks": "Shown in [[Special:Version]]",
+ "version-parser-function-hooks-parsoid": "Shown in [[Special:Version]].\nThis message is followed by the list of parser function hooks which are only available when using Parsoid.",
"version-parsoid-modules": "Part of [[Special:Version]].\nThis message is followed by the list of registered Parsoid extension modules.",
"version-hook-name": "Shown in [[Special:Version]].\n\nFor meaning of hook see [[mw:Special:MyLanguage/Manual:Hooks|mw:Manual:Hooks]] and [[w:Hooking]].",
"version-hook-subscribedby": "Shown in [[Special:Version]]",

File Metadata

Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:31 AM (14 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227475
Default Alt Text
(4 KB)

Event Timeline