TheDJ has uploaded a new change for review.

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

Change subject: Add extension.json
......................................................................

Add extension.json

Bug: T88063
Change-Id: I42afa0bf81f4f89b81a11bcafcb8e4c032a2d173
---
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.php
2 files changed, 16 insertions(+), 15 deletions(-)


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

diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index ddaea80..34fd29b 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -30,6 +30,18 @@
        private static $languages = null;
 
        /**
+        * Register parser hook
+        *
+        * @param $parser Parser
+        * @return bool
+        */
+       public static function configureParser( &$parser ) {
+               $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
+               $parser->setHook( 'syntaxhighlight', array( 
'SyntaxHighlight_GeSHi', 'parserHook' ) );
+               return true;
+       }
+
+       /**
         * Parser hook
         *
         * @param string $text
diff --git a/SyntaxHighlight_GeSHi.php b/SyntaxHighlight_GeSHi.php
index 396a5d3..a11bf31 100644
--- a/SyntaxHighlight_GeSHi.php
+++ b/SyntaxHighlight_GeSHi.php
@@ -36,9 +36,9 @@
        die();
 }
 
-if ( version_compare( $wgVersion, '1.24', '<' ) ) {
-       die( "This version of SyntaxHighlight GeSHi requires MediaWiki 1.24" );
-}
+#if ( version_compare( $wgVersion, '1.24', '<' ) ) {
+#      die( "This version of SyntaxHighlight GeSHi requires MediaWiki 1.24" );
+#}
 
 require_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
 require_once __DIR__ . '/geshi/geshi.php';
@@ -65,6 +65,7 @@
 $wgAutoloadClasses['ResourceLoaderGeSHiModule'] = $dir . 
'ResourceLoaderGeSHiModule.php';
 $wgAutoloadClasses['ResourceLoaderGeSHiLocalModule'] = $dir . 
'ResourceLoaderGeSHiLocalModule.php';
 
+$wgHooks['ParserFirstCallInit'][] = 'SyntaxHighlight_GeSHi::configureParser';
 $wgHooks['ResourceLoaderRegisterModules'][] = 
'SyntaxHighlight_GeSHi::resourceLoaderRegisterModules';
 $wgHooks['ContentGetParserOutput'][] = 'SyntaxHighlight_GeSHi::renderHook';
 $wgHooks['ApiFormatHighlight'][] = 'SyntaxHighlight_GeSHi::apiFormatHighlight';
@@ -80,15 +81,3 @@
  */
 $wgSyntaxHighlightModels[CONTENT_MODEL_CSS] = 'css';
 $wgSyntaxHighlightModels[CONTENT_MODEL_JAVASCRIPT] = 'javascript';
-
-/**
- * Register parser hook
- *
- * @param $parser Parser
- * @return bool
- */
-$wgHooks['ParserFirstCallInit'][] = function ( &$parser ) {
-       $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
-       $parser->setHook( 'syntaxhighlight', array( 'SyntaxHighlight_GeSHi', 
'parserHook' ) );
-       return true;
-};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I42afa0bf81f4f89b81a11bcafcb8e4c032a2d173
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: master
Gerrit-Owner: TheDJ <hartman.w...@gmail.com>

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

Reply via email to