#68 New bbcode - Source Code Highlighting

Patches
closed
Brian Wahoff
5
2014-08-14
2004-10-25
Brian Wahoff
No

GeSHi is a PHP class based Generic Syntax Highlighter
that currently supports about 30 languages. New
languages can be added through external language
definition scripts.
I have modified the textsanitizer class to utilize this
engine adding a new bbcode extension:

[code=<lang>]...[/code]

The following languages are supported by this patch

ASP [code=asp]
C# [code=csharp]
CSS [code=css]
Delphi [code=delphi]
HTML [code=html]
Javascript [code=javascript]
Perl [code=perl]
PHP [code=php]
Python [code=python]
SQL [code=sql]
VB [code=vb]
VB.NET [code=vbnet]
XML [code=xml]

We can optionally include support for several more
languages, these were chosen because of their relative
popularity.

To install this patch, extract the attached file into
the xoops installation directory.

Background:
This patch uses the GeSHi 1.0.2 release (currently only
available in CVS, but stable)
GeSHi Home Page - http://qbnz.com/highlighter/

Discussion

  • Brian Wahoff
    Brian Wahoff
    2004-10-25

    Logged In: YES
    user_id=678143

    Added patch for XOOPS 2.0.9 Beta

     
  • Brian Wahoff
    Brian Wahoff
    2004-10-25

    GeSHi Patch for XOOPS 2.0.9 Beta

     
  • Jan Pedersen
    Jan Pedersen
    2004-10-26

    Logged In: YES
    user_id=841117

    Working nicely on my test install

     
  • Brian Wahoff
    Brian Wahoff
    2004-10-27

    Logged In: YES
    user_id=678143

    I have implemented a version of the GeSHi rendering engine
    that caches the parsed source code for future page calls, in
    my tests I saw rendering time decreases of 75%+ with this
    cache. Also, I ran into script execution timeouts if a user
    put in code over a certain size (I was able to successfully
    parse a source block with 23,000 characters, but it took
    15-20 seconds), so I implemented a max code threshold. If
    the code size is over this threshold the parser will not try
    to synax highlight the code. I set the threshold at 15,000
    characters.

     
  • Brian Wahoff
    Brian Wahoff
    2004-10-27

    GeSHi+caching - XOOPS 2.0.7.3

     
  • Brian Wahoff
    Brian Wahoff
    2004-10-27

    Logged In: YES
    user_id=678143

    added Geshi+Caching for XOOPS 2.0.9 Beta

     
  • Brian Wahoff
    Brian Wahoff
    2004-10-27

    GeSHi+caching - XOOPS 2.0.9 Beta

     
  • Mao
    Mao
    2004-12-23

    Logged In: YES
    user_id=1183441

    Add a smarty/html highlighter in xoops template system will
    be VERY usefull, imho.

     
  • Jan Pedersen
    Jan Pedersen
    2004-12-29

    Logged In: YES
    user_id=841117

    Fixed in CVS and waiting for review before merging to the trunk.

     
  • Jan Pedersen
    Jan Pedersen
    2004-12-30

    Logged In: YES
    user_id=841117

    Re-opened due to bugs in multi-byte languages - Ackbarr will
    follow up on developments and keep us informed

     
  • Bender
    Bender
    2006-08-26

    Logged In: YES
    user_id=1065782

    GeSHi is currently at a stable version of 1.0.7.13.

    Is this patch dead or can we talk about getting it into the
    current Xoops line after all if the multi-byte issues can
    be resolved?

     
  • Closed this item from SF.net tracker.
    GeSHi support available as XOOPS Framework