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:
Gergő Tisza 2018-04-09 10:58:06 +02:00
parent cb5a396fcd
commit 2664e63038
No known key found for this signature in database
GPG key ID: C34FEC97E6257F96
3 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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() ) {

View file

@ -158,8 +158,8 @@
},
"_merge_strategy": "array_plus_2d"
},
"ScribuntoUseGeSHi": false,
"ScribuntoUseCodeEditor": false,
"ScribuntoUseGeSHi": true,
"ScribuntoUseCodeEditor": true,
"ScribuntoGatherFunctionStats": false,
"ScribuntoSlowFunctionThreshold": 0.9
},