Extension talk:SyntaxHighlight GeSHi/Archive 2015

=2009= Found bugs with Powershell language- is there somewhere I can share the fix? If anyone is interested.

=2008=

Strict Mode Parameter meaning
I'm unsure about how the strict paramter for the source tag is supposed to be used, as GeSHi 1.0.8 adds another strict type GESHI_MAYBE while replacing false and true with GESHI_NEVER and GESHI_ALWAYS. Some more information on the exact usage (maybe an example) would be appreciated. --BenBE 21:18, 16 August 2008 (UTC)

Problem with CSS: Default style for pre is overwritten
Hi, the generated output contains CSS classes which overwrite the default pre stlye rules.

How can I change the renedered classes rules? (In my case .source-csharp li, .source-csharp pre and .csharp.source-csharp .de1, .csharp.source-csharp .de2) A quick fix was to declare the base CSS class rules as important, but that's only a hack.

Thanx for help in advance. PJ --IP 19 August 2008


 * Same problem here.
 * Code is highlighted, but without background box, because default pre style is overwritten.
 * MediaWiki 	1.12.0
 * PHP 	5.2.0-8+etch11 (apache2handler)
 * MySQL 	5.0.32-Debian_7etch6-log
 * Any idea? --IP 20 August 2008


 * It does work for me with the following snapshot:
 * SyntaxHighlight_GeSHi-MW1.12-r31252.tar.gz
 * --IP 20 August 2008


 * Thanks for the feedback. I will try the snapshot.
 * But I'd still like to know how I can change the generated CSS class wich is causing the trouble. I found some lines in geshi.php, but not the right one. Perhaps some expert does know how to do it.
 * PJ --IP 20 August 2008

The problem can be fixed by editing file "SyntaxHighlight_GeSHi.class.php". Go to line 192, which should look like $css[] = ".source-$lang {line-height: normal;}"; Change this to $css[] = ".source-$lang {padding: 1em; border: 1px dashed #2f6fab; color: black; background-color: #f9f9f9; line-height: 1.1em;}"; and you have restored the pre css formatting. --KKreuzwieser 21 August 2008

Addition to the point above (2008-09-27): Please note that this didn't take effect for me immediately, it appears PHP caches the class. After making the change to the class as above, comment out the include from LocalSettings.php and refresh your page. Then un-comment out the include and refresh. Worked perfect here, good luck! --IP 26 September 2008


 * Thank you for the answer, but the line did not fix the css problem. --IP 28 August 2008
 * It did fix my problem, which wasn't doing pre tags for any language. I am using MW 1.11.0, geshi 1.0.8, syntaxhighlightgeshi $LastChangedDate: 2008-07-10 08:45:20 -0400 (Thu, 10 Jul 2008) $ --IP 2 September 2008
 * The fix is not needed for MSIE, but does not work in FF 3.0.1. See my Test page and my MediaWiki version (MW 1.13.1, geshi 1.0.8.1). I tryed SyntaxHighlight_GeSHi MW1.13-r37906, trunk-r40401 and trunk 40580. --Milan Keršláger 13:59, 7 September 2008 (UTC)
 * This fix works for me using MSIE(2008-10-28), thanks a lot. The trick is comment out the include from LocalSettings.php and refresh your page.  Then un-comment out the include and refresh. --IP 28 October 2008

If you want to see in   does not change in trunk so Special:Version lie about current version. Even that r37495 nor r40968 does not work. One should debug CSS to find where correct attributes are lost. --Milan Keršláger 01:08, 18 September 2008 (UTC)


 * I tried the code change mentioned above and it fixed this problem in IE6 and FF3. I am using the download link listed in the original instructions (http://geshi.svn.sourceforge.net/svnroot/geshi/branches/RELEASE_1_0_X_STABLE/geshi-1.0.X/src/) and MW 1.12. - R590 --IP 28 October 2008


 * I tried the code change and it works for FF3. However, IE6 is still not behaving properly. I am using Mediawiki 1.13.2 and Geshi 1.0.8.1 with SyntaxHighlight_GeSHi.php from 9-28-2008. Any suggestions? --IP 19 November 2008
 * Try GeSHi 1.0.7.21, not the higher ones. this one works. I think wikipedia is using that version. --IP 17 December 2008

-- Automatist 22:31, 4 March 2009 (UTC)
 * I fixed this (only tested in Firefox) by changing my skin's "main.css" to include the "!important* directive on the various attributes for pre, ie:
 * This alteration to monobook/main.css also seems to work for me with Safari v4b ViktorHaag 15:25, 21 April 2009 (UTC)

Problem with code overflowing page width and no scroll bars
I have recently installed this extension on a new wiki at my work place.

I can see the highlighted code syntax correctly.

If there is a long line of code it flows past the border on the right of the page and looks pretty bad.

On the examples in this extension page, if i resize the page to make it narrow the code does not overflow, a horizontal scrollbar appears.

How do i make this scrollbar appear on my wiki?

The same thing happens when i use the code tag. Any info would be appreciated. Thanks

Danny 88.151.1.10 12:08, 11 September 2008 (UTC)


 * I looked around a bit more on the fact that it wasnt working for the code tag either and found the answer.
 * Project:Support desk
 * 88.151.1.10 12:15, 11 September 2008 (UTC)

Border error
Hi! Why my standard installation of "SyntaxHighlight GeSHi" in MediaWiki software not produce border. I've Perl test sytntax:

Test syntax: http://i38.tinypic.com/biq7om.png

This's produce code without border: http://i38.tinypic.com/2a8qlnp.png

Page source: http://i35.tinypic.com/xmilc3.png

Please Help Me! :)

--Danny373 14:04, 3 October 2008 (UTC)


 * Also experiencing this issue with no border showing by default. I tried using the enclose tags to no avail.
 * Also wanted to suggest the following to allow use of the GESHI_HEADER_PRE_TABLE:


 * I would also like to suggest to expand on the usage within the README file to make it clear which $args are valid and how to use them. I found pointing to the Geshi documentation not that helpful.
 * --alexsch8 11:10 AM, 28 Oct 08 (EDT) --IP 28 October 2008

If you read GeSHi documentation this is expected. SyntaxHighlight GeSHi shouldn't use GESHI_HEADER_PRE_VALID by default, because it will use  as a code container and wiki doesn't put border around   section.

Vchepkov 16:13, 21 January 2009 (UTC)


 * Newer versions of GeSHI very purposefully suppress the pre borders. This is expected. In Wikimedia's older version that they show is a bug, apparently. Splarka 12:34, 17 February 2009 (UTC)

I'm sorry, but has someone actually suggested a way to enable borders here? Is that what the above code is supposed to do? If not, how can I enable borders?
 * solution is above in "Problem with CSS: Default style for pre is overwritten"

SVN "relocated"
If I check http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SyntaxHighlight_GeSHi/, I can see the files fine. However, if I try to check it out from SVN or TortoiseSVN, I get the message

svn: Repository moved permanently to '/viewvc/mediawiki/trunk/extensions/SyntaxHighlight_GeSHi/'; please relocate

As far as I can tell, that's the exact same path as in the URL I pasted. Any thoughts? --SarekOfVulcan 18:03, 9 October 2008 (UTC)


 * Use /svnroot/ instead of /viewvc/. -- Sayuri 19:10, 9 October 2008 (UTC)

README
Should the README file be updated to reflect the stable branch svn URL of GeSHi rather than the trunk path? NSK Nikolaos S. Karastathis 01:15, 27 October 2008 (UTC)


 * Yes, it should as I will not take care to produce stable source in the branch. --BenBE 16:33, 28 January 2009 (UTC)

huge problem after installing
After I followed the installation instructions my wiki looks like this: screenshot. Can anyone please help me? --IP 3 November 2008


 * You've downloaded the wrong file.
 * You've downloaded instade of open this link.
 * When you've opended this link, choice a revision and click on the download link.
 * Same procedre for the other files:
 * -- MichaelFrey 17:05, 4 November 2008 (UTC)

internal bookmarks
I administrate a wiki about programming, and some of its content is source code. I would like to link from the documentation of each element to the element itself in the source on the same page. I've figured out how to break out of the tags to insert an id'ed span element, but this forces readers to tediously highlight the source one small segment at a time. Does GeSHi support bookmarks yet? If not, can they be supported? Thanks! --Jesdisciple 05:16, 12 November 2008 (UTC)

Border/css/pre Problem is back
Guys is it possible that the Quarterly MW release 1.13 broke this extension? I am running 1.13.3. Only the CSS hack above fixed the problem (combined with apache restart as well). Could this is be a parameter passing issue as well? Thanks everyone! Frankk74 05:12, 29 December 2008 (UTC)


 * I confirm that the border problem is present in the latest version of GeSHi (as of 20-Jan-2009). The above CSS hack worked wonders. Thanks! liyf. 20 January 2009


 * Frankk74, I just had a similar problem and was about to take your advice and restart apache, when I made a small amendment to the entry I was testing on, it fixed all the formatting bits an pieces I had been attempting. MW must be caching these pages assuming nothing is changing on the backend. I am a bit more comfortable now. - ChrisKing. 9 February 2009

=2009=

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

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 ?

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 on the above and it works! -- Frankz (talk) 16:26 April 17, 2009 (EST)

Here is solution: go to /extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php find $wgParser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) ); replaced with $wgParser->setHook( 'sources', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) );