diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php index 4538a5f1..7318574d 100644 --- a/SyntaxHighlight_GeSHi.class.php +++ b/SyntaxHighlight_GeSHi.class.php @@ -327,6 +327,9 @@ class SyntaxHighlight_GeSHi { * @return GeSHi */ public static function prepare( $text, $lang ) { + + global $wgSyntaxHighlightKeywordLinks; + self::initialise(); $geshi = new GeSHi( $text, $lang ); if( $geshi->error() == GESHI_ERROR_NO_SUCH_LANG ) { @@ -335,7 +338,7 @@ class SyntaxHighlight_GeSHi { $geshi->set_encoding( 'UTF-8' ); $geshi->enable_classes(); $geshi->set_overall_class( "source-$lang" ); - $geshi->enable_keyword_links( false ); + $geshi->enable_keyword_links( $wgSyntaxHighlightKeywordLinks ); // If the source code is over 100 kB, disable higlighting of symbols. // If over 200 kB, disable highlighting of strings too. diff --git a/SyntaxHighlight_GeSHi.php b/SyntaxHighlight_GeSHi.php index 0b6cb0c6..5372342d 100644 --- a/SyntaxHighlight_GeSHi.php +++ b/SyntaxHighlight_GeSHi.php @@ -48,7 +48,10 @@ $wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi'] = array( 'url' => 'https://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi', ); -$wgSyntaxHighlightDefaultLang = null; //Change this in LocalSettings.php +// Change these in LocalSettings.php +$wgSyntaxHighlightDefaultLang = null; +$wgSyntaxHighlightKeywordLinks = false; + $dir = dirname(__FILE__) . '/'; $wgExtensionMessagesFiles['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.i18n.php'; $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.class.php';