Namespace rest of the extension

Global alias of SyntaxHighlight left behind for migration

Change-Id: I35b2caa42ac91454abe359949e360d1601748121
This commit is contained in:
Reedy 2022-03-13 00:16:29 +00:00
parent ded00be15b
commit 39b4f0c7c1
5 changed files with 32 additions and 8 deletions

View file

@ -29,9 +29,7 @@
},
"AutoloadClasses": {
"SyntaxHighlight": "includes/SyntaxHighlight.php",
"SyntaxHighlightAce": "includes/SyntaxHighlightAce.php",
"SyntaxHighlightGeSHiCompat": "includes/SyntaxHighlightGeSHiCompat.php",
"ResourceLoaderSyntaxHighlightVisualEditorModule": "includes/ResourceLoaderSyntaxHighlightVisualEditorModule.php"
"MediaWiki\\SyntaxHighlight\\SyntaxHighlight": "includes/SyntaxHighlight.php"
},
"ResourceFileModulePaths": {
"localBasePath": "modules",
@ -58,7 +56,7 @@
]
},
"ext.geshi.visualEditor": {
"class": "ResourceLoaderSyntaxHighlightVisualEditorModule",
"class": "MediaWiki\\SyntaxHighlight\\ResourceLoaderSyntaxHighlightVisualEditorModule",
"scripts": [
"ve-syntaxhighlight/ve.dm.MWSyntaxHighlightNode.js",
"ve-syntaxhighlight/ve.dm.MWBlockSyntaxHighlightNode.js",

View file

@ -16,6 +16,11 @@
* http://www.gnu.org/copyleft/gpl.html
*/
namespace MediaWiki\SyntaxHighlight;
use ResourceLoaderContext;
use ResourceLoaderFileModule;
class ResourceLoaderSyntaxHighlightVisualEditorModule extends ResourceLoaderFileModule {
protected $targets = [ 'desktop', 'mobile' ];

View file

@ -16,9 +16,23 @@
* http://www.gnu.org/copyleft/gpl.html
*/
namespace MediaWiki\SyntaxHighlight;
use Content;
use ExtensionRegistry;
use FormatJson;
use Html;
use IContextSource;
use MediaWiki\MediaWikiServices;
use MediaWiki\SyntaxHighlight\Pygmentize;
use MediaWiki\SyntaxHighlight\PygmentsException;
use MWException;
use Parser;
use ParserOptions;
use ParserOutput;
use Sanitizer;
use Status;
use TextContent;
use Title;
use WANObjectCache;
class SyntaxHighlight {
@ -84,8 +98,8 @@ class SyntaxHighlight {
* @param Parser $parser
*/
public static function onParserFirstCallInit( Parser $parser ) {
$parser->setHook( 'source', [ 'SyntaxHighlight', 'parserHookSource' ] );
$parser->setHook( 'syntaxhighlight', [ 'SyntaxHighlight', 'parserHook' ] );
$parser->setHook( 'source', [ self::class, 'parserHookSource' ] );
$parser->setHook( 'syntaxhighlight', [ self::class, 'parserHook' ] );
}
/**
@ -573,3 +587,5 @@ class SyntaxHighlight {
}
}
}
class_alias( SyntaxHighlight::class, 'SyntaxHighlight' );

View file

@ -16,6 +16,8 @@
* http://www.gnu.org/copyleft/gpl.html
*/
namespace MediaWiki\SyntaxHighlight;
/**
* Class provides functionality to map Ace lexer definitions
*/

View file

@ -15,6 +15,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*/
namespace MediaWiki\SyntaxHighlight;
class SyntaxHighlightGeSHiCompat {
/** @var array A mapping of GeSHi lexer names to compatible Pygments lexers. */
private static $compatibleLexers = [