mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-27 15:50:37 +00:00
Namespace rest of the extension
Global alias of SyntaxHighlight left behind for migration Change-Id: I35b2caa42ac91454abe359949e360d1601748121
This commit is contained in:
parent
ded00be15b
commit
39b4f0c7c1
|
@ -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",
|
||||
|
|
|
@ -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' ];
|
||||
|
|
|
@ -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' );
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
namespace MediaWiki\SyntaxHighlight;
|
||||
|
||||
/**
|
||||
* Class provides functionality to map Ace lexer definitions
|
||||
*/
|
||||
|
|
|
@ -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 = [
|
||||
|
|
Loading…
Reference in a new issue