mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-23 22:13:40 +00:00
Merge "Expose Pygments version on Special:Version"
This commit is contained in:
commit
a5be55b248
|
@ -101,7 +101,8 @@
|
|||
],
|
||||
"ApiFormatHighlight": [
|
||||
"SyntaxHighlight::onApiFormatHighlight"
|
||||
]
|
||||
],
|
||||
"SoftwareInfo": "SyntaxHighlight::onSoftwareInfo"
|
||||
},
|
||||
"attributes": {
|
||||
"SyntaxHighlight": {
|
||||
|
|
|
@ -558,4 +558,18 @@ class SyntaxHighlight {
|
|||
// Inform MediaWiki that we have parsed this page and it shouldn't mess with it.
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook to add Pygments version to Special:Version
|
||||
*
|
||||
* @see https://www.mediawiki.org/wiki/Manual:Hooks/SoftwareInfo
|
||||
* @param array &$software
|
||||
*/
|
||||
public static function onSoftwareInfo( array &$software ) {
|
||||
try {
|
||||
$software['[https://pygments.org/ Pygments]'] = Pygmentize::getVersion();
|
||||
} catch ( PygmentsException $e ) {
|
||||
// pass
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue