Safe Source Code Highlighting in WordPress 2.02 – Take 2

Well the good news is that the Syntax highlighting is back!

I’ve found another implementation of the GeSHi Syntax highlighter. This one is under current development and in fact version 3.5 (as opposed to 0.2 of that OTHER highlighter) was just released a week or two ago.

The igHiliter 3.5 is available here: http://blog.igeek.info/still-fresh/2006/02/25/code-for-fun/
Now, instead of using braces and code tags, I must use brackets:
[html]

10 Goto 10

[/html]

I use brackets like so:
[code]
[somelang]
10 Goto 10
[/somelang]
[/code]

This seems to work VERY well, but having learned my lesson, I’ll hold my review till I’ve had a chance to fully test. I’ve already made some changes to the source code to, IMHO, improve the appearance and make it look a bit more standard & professional. I was pleasantly surprised by the quality of the source code. The simple fact that it is consistent in its Styles and Standards (capitalization & spacing), well commented and easy to read, carries high marks in my book.

The integration with GeSHi has been done very smoothly. The standard languages supported in the program are quite sufficient for my needs (a bit over kill really since I won’t be touching Ruby any time soon and while I’ve used it, I won’t be posting Python here any time soon either. So, the author wisely choose not to provide built in support for all possible GeSHi languages. Instead, the plugin is fully compatible with all GeSHi plugins. You gotta love a plugin with plugins. Where will it end?!?!?!

And I learned something new tonight too.

All of those buttons above the editor are contained within the file:
/wp-includes/js/quicktags.js

The format is pretty straight forward. So, for instance, to add a button for the delphi tag, I just put in:
[javascript]
edButtons[edButtons.length] =
new edButton(‘ed_shDELPHI’
,’DELPHI’
,'{delphi}’
,'{/delphi}’
,”
);
[/javascript]

Actually, I’d use brackets instead of braces, but you get the idea.
Those fields are
1. Button Label
2. Openning tag
3. Closing tag
4. Hot key
5. Open Ended Key (0/blank=FALSE -1=TRUE=tag does not need to be closed)

I’ve got some plans for this file!!!!

Add a Comment

Your email address will not be published. Required fields are marked *