summaryrefslogtreecommitdiff
path: root/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php')
-rw-r--r--extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php36
1 files changed, 26 insertions, 10 deletions
diff --git a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php
index 15592aa6..5372342d 100644
--- a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php
+++ b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php
@@ -45,23 +45,39 @@ $wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi'] = array(
'name' => 'SyntaxHighlight',
'author' => array( 'Brion Vibber', 'Tim Starling', 'Rob Church', 'Niklas Laxström' ),
'descriptionmsg' => 'syntaxhighlight-desc',
- 'url' => 'http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi',
+ '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';
-$wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook';
$wgHooks['ParserFirstCallInit'][] = 'efSyntaxHighlight_GeSHiSetup';
+$wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi';
-if ( version_compare( $wgVersion, '1.17alpha', '>=' ) ) {
- // For MediaWiki 1.17 alpha and later.
- $wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi';
-} else {
- // For pre-MediaWiki 1.17 alpha.
- $wgHooks['SpecialVersionExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hOldSpecialVersion_GeSHi';
-}
+//if ( defined( 'MW_SUPPORTS_CONTENTHANDLER' ) ) {
+ // since MW 1.21
+// $wgHooks['ContentGetParserOutput'][] = 'SyntaxHighlight_GeSHi::renderHook';
+//} else {
+ // B/C until 1.20
+ $wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook';
+//}
+
+
+$wgAutoloadClasses['HighlightGeSHilocal'] = $dir . 'SyntaxHighlight_GeSHi.local.php';
+$wgResourceModules['ext.geshi.local'] = array( 'class' => 'HighlightGeSHilocal' );
+
+/**
+ * Map content models to the corresponding language names to be used with the highlighter.
+ * Pages with one of the given content models will automatically be highlighted.
+ */
+$wgSyntaxHighlightModels = array(
+ CONTENT_MODEL_CSS => 'css',
+ CONTENT_MODEL_JAVASCRIPT => 'javascript',
+);
/**
* Register parser hook