Extension talk:GeSHiCodeTag

For questions/comments/suggestions/etc. please post it here.

QUESTIONS
Please add:

Q: for questions

A: for answers

GeSHiCodeTag and templates
Q: GeSHiCodeTag doesn't work good with templates using pure html.

A: To make it work better, turn off the "simple" mode in GeshiCodeTag.php:

// 1 - enabled, 0 - disabled $codeTag["simple"] = 0;                      // ex. &lt;php&gt; echo &lt;/php&gt; $codeTag["advanced"] = 1;                    // ex. &lt;code php n&gt; echo &lt;/php&gt;

It appears that the "simple" mode for the DIV language will interfere with any &lt;div&gt; elements in HTML code.

Auto indentation
Q: The Beautifier syntax highlighting engine supports auto indentation. Can GeSHi do this too?

A: I've looked on the Geshi documentation, and it seems to me that there's no feature for auto indentation. For more features available for GeSHi check out the link.

NOTICE after installation
Q: i've install geshi and get 2 NOTICEs

Notice: Use of undefined constant div - assumed 'div' in extensions/GeSHICodeTag.php(55) : runtime-created function on line 1

Notice: Undefined variable: languagesPath in extensions/GeSHICodeTag.php(55) : runtime-created function on line 1

and i cant turn the notice off by

error_reporting(E_ALL ^ E_NOTICE);

what can i do ?

A: Can you please specify the version of geshi you're using and the version of mediawiki? I'll try to test out and see if there's a fix that I can do. Thanks! --Paul516 22:03, 8 February 2007 (UTC)

COMMENTS
Q: This plugin and the code on other sites to do syntax highlighting with GeSHi in Mediawiki does not seem to work with older versions of MediaWiki - including the current default install on Ubuntu Dapper: mediawiki v 1.4.14. Can anyone confirm that? When I try, everything seems to work but the text does not get highlighted. If anyone can confirm or deny this, please comment here!

A: I've tried installing a Mediawiki 1.4.14 using GeSHi-1.0.7.12 and GeSHiCodeTag 1.5 it seems that only the simple mode works. There seems to be some slight differences on how the parsing is setup in the older versions. I'll try to see if I can fix it to work in advanced mode as well. --Paul516 06:37, 24 September 2006 (UTC)

A: I just read somewhere that from Mediawiki 1.5 they support giving an argument to a tag. This indeed means that in previous versions only simple mode would work.

Q: I downloaded the code, and it only worked for simple mode. After a while of editing, the problem appeared to be the use of strict mode (which in a previous version was not used by default). Also, the examples at http://www.wikics.org/GeshiCodeTag_Samples suffer from the same problem.

I have removed the strict mode line, and now it works fine. Btw: I use mediawiki 1.6.8 and GeSHi-1.0.7.15.

A: Hmm... if that the case then I'll just disable the strict mode by default. Also instead of removing the line, you can just set it to  0 (false) so you'll still have the feature if you want to enable it later on --Paul516 18:28, 10 November 2006 (UTC)

Q: I just installed GeSHi-1.0.7.16 with mediawiki 1.9.0. When I try to use it, I get error: Undefined index: STRICT_MODE_APPLIES ..... in geshi.php line 1018 I browsed the geshi code, and I just don't understand why this error occurs. There is STRICT_MODE_APPLIES in language file (I'm using php.php), and constants GESHI_MAYBE, etc. are defined. Can somebody help me? Right for now I just disabled check for STRICT_MODE_APPLIES in code.

An easy fix for the "div" problem is just to rename the geshi/div.php file to something not needed for a tag (I used divg.php). I don't know if this will have unintended consequences, but I haven't seen any and it did fix the munging of the message that appears under the edit box and all other places where the "div" tag was in use as far as I can tell. --Woozle 19:32, 10 March 2007 (UTC)

SUGGESTIONS
Q. No biggie but the name and author in the credits are switched. In Special:Version it shows up as Paul Nolasco by GeshiCodeTag. --Icep 23:55, 24 September 2006 (UTC)

A. Thanks for telling me! Fixed :) --Paul516 05:26, 25 September 2006 (UTC)

Q: How would you make a default language so automatically highlights it to a certain language?