mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-15 02:24:07 +00:00
Add Option to Enable Keyword Links
Patch by Bryan Petty Bug: 53787 Change-Id: I8c818859df8240cfcfef94d06d5d12a848cc76dc
This commit is contained in:
parent
32f2019420
commit
cd001a9ed9
|
@ -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.
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue