mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-30 17:14:55 +00:00
SyntaxHighlightVisualEditorModule: Use Context::encodeJson() instead
Also fixes the Phan warning about Xml::encodeJsCall/FormatJson needing booleaen where int inDebugMode() is passed. Change-Id: Id8de16ab683948eae096b43462118ea837f53038
This commit is contained in:
parent
123f8677fc
commit
fa20f69cf4
|
@ -26,23 +26,16 @@ class ResourceLoaderSyntaxHighlightVisualEditorModule extends ResourceLoaderFile
|
|||
*/
|
||||
public function getScript( ResourceLoaderContext $context ) {
|
||||
$scripts = parent::getScript( $context );
|
||||
|
||||
return $scripts . Xml::encodeJsCall(
|
||||
've.dm.MWSyntaxHighlightNode.static.addPygmentsLanguages', [
|
||||
$this->getPygmentsLanguages()
|
||||
],
|
||||
ResourceLoader::inDebugMode()
|
||||
) . Xml::encodeJsCall(
|
||||
've.dm.MWSyntaxHighlightNode.static.addGeshiToPygmentsMap', [
|
||||
SyntaxHighlightGeSHiCompat::getGeSHiToPygmentsMap()
|
||||
],
|
||||
ResourceLoader::inDebugMode()
|
||||
) . Xml::encodeJsCall(
|
||||
've.dm.MWSyntaxHighlightNode.static.addPygmentsToAceMap', [
|
||||
SyntaxHighlightAce::getPygmentsToAceMap()
|
||||
],
|
||||
ResourceLoader::inDebugMode()
|
||||
);
|
||||
return $scripts
|
||||
. 've.dm.MWSyntaxHighlightNode.static.addPygmentsLanguages('
|
||||
. $context->encodeJson( $this->getPygmentsLanguages() )
|
||||
. ');'
|
||||
. 've.dm.MWSyntaxHighlightNode.static.addGeshiToPygmentsMap('
|
||||
. $context->encodeJson( SyntaxHighlightGeSHiCompat::getGeSHiToPygmentsMap() )
|
||||
. ');'
|
||||
. 've.dm.MWSyntaxHighlightNode.static.addPygmentsToAceMap('
|
||||
. $context->encodeJson( SyntaxHighlightAce::getPygmentsToAceMap() )
|
||||
. ');';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue