Extension talk:SyntaxHighlight GeSHi/Archive 2009

Fatal Error?
After I installed it, I tried

Then the browser turned into a white background with words like that."

Fatal error: Call to undefined function wfLoadExtensionMessages in D:\wamp\www\mediawiki-1.9.3\extensions\SyntaxHighlight_GeSHi\SyntaxHighlight_GeSHi.class.php on line 288 "

the line 288 of SyntaxHighlight_GeSHi.class.php is this: wfLoadExtensionMessages( 'SyntaxHighlight_GeSHi' );

I think I must miss something important when I installed this extension. Any one can help?

Not using external stylesheet
The documentation for GeSHi states:

in particular, if you’re making a plugin for a forum/wiki/other system, using an external stylesheet is a good idea!

Still, this extension outputs the CSS for used classes inline, in the  function. This is inelegant (includes presentation information in HTML code), wasteful (a block of CSS for every page request) and redundant (in case an installation also uses the MediaWiki:Geshi.css page). --IP 4 January 2009

SQL
hi, i get the following error message after installing it:

GeSHi Error: GeSHi could not find the language php (using path D:\www\www1145\Techie\extensions\SyntaxHighlight_GeSHi\geshi\geshi\) (code 2)

You need to specify a language like this: "

Supported languages for syntax highlighting:

abap, actionscript, actionscript3, ada, apache, applescript, apt_sources, asm, asp, autoit, avisynth, bash, basic4gl, bf, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, cil, cobol, cpp, cpp-qt, csharp, css, d, delphi, diff, div, dos, dot, eiffel, email, fortran, freebasic, genero, gettext, glsl, gml, gnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5

and i was wondering aswell if i can use the language sql or do i need another extension for this?

because i made my own wiki site and i wanted to copy a link from the original wikipedia site but it wont display it correctly, it keeps saying

and i want to get rid of that source language tag and let it be displayed correctly, do i need another extension for that??

thanks

PHP: Call_user_func_array error
Have just installed the extension for the customer - verified permissions and installation several times, and have checked out latest code from SVN, but am getting the following error message:

Warning: call_user_func_array: First argumented is expected to be a valid callback, 'SyntaxHighlight_GeSHi::parserHook' was given in /home/username/public_html/includes/Parser.php on line 468

Are there any issues with particular versions of MediaWiki?

I get a similar error on Mediawiki 1.5.8 Warning: call_user_func_array [function.call-user-func-array]: First argument is expected to be a valid callback, 'SyntaxHighlight_GeSHi::parserHook' was given in C:\wamp\www\wiki\includes\Parser.php on line 436 --202.12.233.21 01:10, 3 February 2009 (UTC)

I get the same thing running MediaWiki on a Windows server. Tried everything. Given up.


 * That sounds like the kind of error you'd get running a new extension on an outdateved version of mediawiki. According to the descriptions, it should work on Mediawiki versions 1.10+. -Steve Sanbeg 00:39, 26 February 2009 (UTC)

I had the same problem. I used this extension: [] with PHP4 and MW 1.6 and it works with GeSHi 1.0.7

Found bugs with Powershell language
Found bugs with Powershell language- is there somewhere I can share the fix? If anyone is interested.
 * Problems and bugs with language files should be reported upstream to BenBE@geshi.org. This also includes bugs when the highlighted version visually includes additional characters that didn't appear in your source --BenBE 13:02, 24 April 2009 (UTC)

Add character at the beginning of each line
I want to use this extension to add a special character at the beginning of each line like "#" for root shell or "$" for user shell. Is it possible ? Do you have any idea how I can do that ?
 * You can use the CSS :after pseudo-class to add additional content. --BenBE 13:04, 24 April 2009 (UTC)

Unclear Installation and Pre-Requisite Instructions
Do I need to install Geshi into my PHP directory before I install the Geshi MediaWiki Extension? Also are there any prerequisites for this extension? Like the Geshi extension or the stub manager please? Thanks!

Also: step 2 of "installation" instructions is confusing for me, being somewhat new to both mediawiki and unix environment. I do NOT have shell access to my account, and though step 1 leads me to believe I don't need shell access, step 2 is explained as if I do have it. Can this be clarified?

Casing problem with T-SQL
Many of the keywords (System Stored Procedures) are in lower case. Using GESHI causes things like sp_executesql to be rendered as SP_EXECUTESQL, which is not a valid procedure. Very easy fix, I know (just change the file ...SyntaxHighlight_GeSHi/geshi/geshi/tsql.php to use "GESHI_CAPS_NO_CHANGE" instead of "GESHI_CAPS_UPPER") but should be set that way be default.

== Error if i have // This is the original source from my XML file  

How can i fix that? Please help! Thanks in advance! -- Frankz (talk) 14:12 April 17, 2009 (EST)


 * Now I hacked into SyntaxHighlight_GeSHi.php added 's' to the end of 'source' and replaced

In SyntaxHighlight_GeSHi.class.php, I changed the parserHook function.

The original code:

Modified code:

I hope someone will find it useful.

Template Expansion
Apologies ahead of time if it's bad etiquette to post here. I've been at this all day and am pretty frustrated. Desperate.

I want to create code templates where I have something like Template:MyTemplate

Turns out that the template variables don't get expanded, and my life is very unhappy.

Is it possible to make this work?

I have been doing some research and this might legitimately be a limitation of mediawiki. I'm too new to understand whether this is exactly the problem, and whether any of the suggested workarounds can help me. Thanks in advance if anyone can throw me a bone.


 * I followed your bug link above and it seems as if it's been fixed. I just ran into the same issue where I'd like to pass code into a template that has a parameter inside of my code tags.  Does anyone know how to do this? --Gkullberg 19:26, 12 November 2009 (UTC)


 * How about me? I have a similar problem. I'd like to create a template called "source code" as follows:

I tried making this sample in my template but seemed not working as expected:

The problem is that the second argument, remains as if it is a string "" not a variable. Can any one correct this for me?--Email4mobile 00:31, 28 January 2010 (UTC)

Is Vimscript supported or not?
The error I get when doing

Where is the geshi.php file?
--almaghi 22:17, 29 June 2009 (UTC)


 * It should be in a subdirectory of your extension called 'geshi'. (ie: MW_ROOT/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php). Note that this is automatically checked out in SVN, it's set as an external and grabs directly from the GeSHi project. ^demon 20:03, 30 June 2009 (UTC)

Request for vCard and iCalendar language support
It would be great if vCard (RFC 2426) and iCalendar (RFC 2445) language support could be added to the extension.

Here are examples of two of several wiki pages that would make use of this feature:


 * http://microformats.org/wiki/value-dt-test-YYYY-MM-DD--HH-MM#expected_iCalendar_output
 * http://microformats.org/wiki/value-dt-test-abbr-YYYY-MM-DD--HH-MM#expected_iCalendar_output

Thanks for your consideration. Tantek 23:29, 6 July 2009 (UTC)
 * Compile some language file for those two formats and forward the final language files to me (when they pass the langcheck script). --BenBE 12:43, 2 May 2010 (UTC)

PHP Warnings
MediaWiki 1.15.1

GeSHi 1.0.8.4

PHP Warning: preg_match: Compilation failed: unrecognized character after (?< at offset 3 in /www/mediawiki/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 2132

To fix this replace following lines in extensions\SyntaxHighlight_GeSHi\geshi\geshi\php.php:

With these:

Getting another language supported
How do I get another language supported by the Geshi support in Wikibooks? The Geshi syntax file is already written, but presumably needs to be added or installed at some location? Newlisp 07:17, 27 September 2009 (UTC)
 * It's in current releases, thus the guys of the MW extension need to pull an updated GeSHi release and install it here. IDK when they will do. At least: 1.0.8.8 is coming soon. --BenBE 12:41, 2 May 2010 (UTC)

Problem with z80 code
When using the keyword ret in z80 assembler, it becomes after adding

and you get this:

Notice: Undefined index:  KEYWORDS in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 1925 Warning: array_keys [function.array-keys]: The first argument should be an array in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 1925 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 1925 Notice: Undefined index:  ESCAPE_CHAR in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 2270 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 2290 Warning: implode [function.implode]: Argument to implode must be an array. in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3242 Notice: Undefined index:  KEYWORDS in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3265 Warning: array_keys [function.array-keys]: The first argument should be an array in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3265 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3265 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3306 Notice: Undefined index:  KEYWORDS in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3357 Warning: array_keys [function.array-keys]: The first argument should be an array in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3357 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3357 Notice: Undefined index:  OOLANG in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3388 Warning: array_keys [function.array-keys]: The first argument should be an array in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3502 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 3502 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 4338 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 4345 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 4354 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 4363 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 4368 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 4373 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 4382 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 4387 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 4393 Warning: Invalid argument supplied for foreach in /var/www/html/w/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php on line 4398

This seems like an easy case to catch and display a more friendly message.... Maiden taiwan 19:41, 19 November 2009 (UTC)


 * Easy fix in SyntaxHighlight_GeSHi.class.php function parserHook: Change this:

if( isset( $args['lang'] ) ) {


 * to this:

if( isset( $args['lang'] ) && $args['lang'] ) {


 * The warnings are gone. Maiden taiwan 19:48, 19 November 2009 (UTC)
 * Thanks, committed in r59269. Max Semenik 20:38, 19 November 2009 (UTC)

Can't download for 1.15.x via Extension Distributor
When I try and download via the ExtensionDistributor, I choose my wiki version (1.15.x) and then get this error: Invalid response from remote subversion client.
 * Must be an intermittent glitch, it worked for me. Use this direct link. Max Semenik 17:39, 24 November 2009 (UTC)