mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-24 00:05:00 +00:00
Use CodeEditor and SyntaxHighlight when available
There is no reason not to default to using these when they are there. Bug: T191737 Change-Id: Id1b918a538a45c1279e3e4ad87b2a40f8d41478d
This commit is contained in:
parent
cb5a396fcd
commit
2664e63038
|
@ -75,12 +75,12 @@ $wgScribuntoEngineConf = [
|
|||
/**
|
||||
* Set to true to enable the SyntaxHighlight_GeSHi extension
|
||||
*/
|
||||
$wgScribuntoUseGeSHi = false;
|
||||
$wgScribuntoUseGeSHi = true;
|
||||
|
||||
/**
|
||||
* Set to true to enable the CodeEditor extension
|
||||
*/
|
||||
$wgScribuntoUseCodeEditor = false;
|
||||
$wgScribuntoUseCodeEditor = true;
|
||||
|
||||
/**
|
||||
* Set to true to enable gathering and reporting of performance data
|
||||
|
|
|
@ -124,7 +124,7 @@ class ScribuntoContent extends TextContent {
|
|||
|
||||
// Add HTML for the actual script
|
||||
$language = $engine->getGeSHiLanguage();
|
||||
if ( $wgScribuntoUseGeSHi && $language ) {
|
||||
if ( $wgScribuntoUseGeSHi && class_exists( SyntaxHighlight_GeSHi::class ) && $language ) {
|
||||
$geshi = SyntaxHighlight_GeSHi::prepare( $text, $language );
|
||||
$geshi->set_language( $language );
|
||||
if ( $geshi instanceof GeSHi && !$geshi->error() ) {
|
||||
|
|
|
@ -158,8 +158,8 @@
|
|||
},
|
||||
"_merge_strategy": "array_plus_2d"
|
||||
},
|
||||
"ScribuntoUseGeSHi": false,
|
||||
"ScribuntoUseCodeEditor": false,
|
||||
"ScribuntoUseGeSHi": true,
|
||||
"ScribuntoUseCodeEditor": true,
|
||||
"ScribuntoGatherFunctionStats": false,
|
||||
"ScribuntoSlowFunctionThreshold": 0.9
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue