Version: 1.00, by Andreas
Developer Last Online: Jan 2023
Version: 3.5.0 RC1
Rating:
Released: 07-27-2005
Last Update: Never
Installs: 143
Uses Plugins Template Edits
Additional Files Is in Beta Stage
No support by the author.
Advanced Syntax Highlighting
This Hack provides a [highlight] BBCode to highlight a wide range of Languages such as XML, HTML, Java, Javascript, SQL and so on.
It uses GeSHi, which is included in this ZIP.
Details
1 Product XML with 2 Plugins and 2 Templates
Please only click Install if you actually have installed/are using this Hack, and click Uninstall whan you don't use it any longer!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Have you any hint, where i can switch the width for bbcode code to 100%?
Thank you
thomas
Well, you can change it here, Styles & Templates -> Style Manager -> StyleVars -> Sizes and Dimensions -> Code Block Width, but IE will stretch the entire page to the dimension of the code.
I can confirm that this works in 3.6.4; you can update the range of available languages by grabbing the latest version of "geshi.php" and the "geshi" directory from the developer's site -- http://qbnz.com/highlighter/
I fixed the square bracket issue (which also happens with percentage symbols) by adding the following line to the parse_code function in geshi.php (just before "// Initialise various stuff"):
Thank you .. with this line it works fine for me .. but the bug with the tabs and spacings does already exists =/ After preview or on edit all spaces and tabs bevore the commands are missing .. Any ideas?
Okay there's a few different things contributing to the whitespace/line-break formatting problems. I had to hack quite a bit to fix all this, so I've just uploaded my edited gehsi.php -- http://www.brothercake.com/clients/geshi.zip
All the changes I made begin with a comment that says "20070518 -- brothercake". Apart from fixing these issues, I've also removed the list markup (because line-numbers were being copied into the clipboard in some browsers), while retaining fancy lines (alternate line highlighting). And I've also stripped out some of the markup it generates - everything apart from what's actually needed!
To make these changes work I also had to comment out four lines from the product (the code inside the XML file):
PHP Code:
//################################################################
//20070518 -- brothercake mod commented these lines so we can control from geshi.php directly
// $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
// $tabs = 4;
// $geshi->set_header_type(GESHI_HEADER_DIV);
// $geshi->set_tab_width($tabs);
//################################################################
Hope this is useful It's all pretty brutal, but it works!