Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/82854


Change subject: Add Option to Enable Keyword Links
......................................................................

Add Option to Enable Keyword Links

Patch by Bryan Petty

Bug: 53787
Change-Id: I8c818859df8240cfcfef94d06d5d12a848cc76dc
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.php
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/54/82854/1

diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index 4538a5f..7318574 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -327,6 +327,9 @@
         * @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 @@
                $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 0b6cb0c..5372342 100644
--- a/SyntaxHighlight_GeSHi.php
+++ b/SyntaxHighlight_GeSHi.php
@@ -48,7 +48,10 @@
        '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';

-- 
To view, visit https://gerrit.wikimedia.org/r/82854
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c818859df8240cfcfef94d06d5d12a848cc76dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: master
Gerrit-Owner: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to