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
|
* Set to true to enable the SyntaxHighlight_GeSHi extension
|
||||||
*/
|
*/
|
||||||
$wgScribuntoUseGeSHi = false;
|
$wgScribuntoUseGeSHi = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to true to enable the CodeEditor extension
|
* Set to true to enable the CodeEditor extension
|
||||||
*/
|
*/
|
||||||
$wgScribuntoUseCodeEditor = false;
|
$wgScribuntoUseCodeEditor = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to true to enable gathering and reporting of performance data
|
* 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
|
// Add HTML for the actual script
|
||||||
$language = $engine->getGeSHiLanguage();
|
$language = $engine->getGeSHiLanguage();
|
||||||
if ( $wgScribuntoUseGeSHi && $language ) {
|
if ( $wgScribuntoUseGeSHi && class_exists( SyntaxHighlight_GeSHi::class ) && $language ) {
|
||||||
$geshi = SyntaxHighlight_GeSHi::prepare( $text, $language );
|
$geshi = SyntaxHighlight_GeSHi::prepare( $text, $language );
|
||||||
$geshi->set_language( $language );
|
$geshi->set_language( $language );
|
||||||
if ( $geshi instanceof GeSHi && !$geshi->error() ) {
|
if ( $geshi instanceof GeSHi && !$geshi->error() ) {
|
||||||
|
|
|
@ -158,8 +158,8 @@
|
||||||
},
|
},
|
||||||
"_merge_strategy": "array_plus_2d"
|
"_merge_strategy": "array_plus_2d"
|
||||||
},
|
},
|
||||||
"ScribuntoUseGeSHi": false,
|
"ScribuntoUseGeSHi": true,
|
||||||
"ScribuntoUseCodeEditor": false,
|
"ScribuntoUseCodeEditor": true,
|
||||||
"ScribuntoGatherFunctionStats": false,
|
"ScribuntoGatherFunctionStats": false,
|
||||||
"ScribuntoSlowFunctionThreshold": 0.9
|
"ScribuntoSlowFunctionThreshold": 0.9
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue