#1
  1. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117

    New bbcode highlighter


    We have added a new bbcode called highlighter which is used for generic syntax highlighting. It supports a wide range of popular languages.

    Usage :
    [ highlight=language ]
    Codes
    [ /highlight ]

    Sample Java code:
    java Code:
     
    	public static String backslashQuotes(String s) {
    		if (s != null) {
    			int len = s.length();
    			StringBuffer buf = new StringBuffer(len + 10);
    			char c = '\0';
    			for (int i = 0; i < len; i++) {
    				c = s.charAt(i);
    				if (c == '"') {
    					buf.append('\\');
    				}
    				buf.append(c);
    			}
     
    			return buf.toString();
    		}
    		else {
    			return null;
    		}
    	}




    Here is the list of languages supported by this new bbcode:

    actionscript
    ada
    apache
    asm
    asp
    bash
    caddcl
    cadlisp
    c_mac
    c
    cpp
    csharp
    css-gen.cfg
    css
    delphi
    diff
    div
    d
    eiffel
    gml
    html4strict
    java
    javascript
    lisp
    lua
    matlab
    mpasm
    nsis
    objc
    oobas
    oracle8
    pascal
    perl
    php-brief
    php
    python
    qbasic
    smarty
    sql
    vbnet
    vb
    vhdl
    visualfoxpro
    xml

    Comments on this post

    • gimp agrees
    • bharatsha7 agrees
    Last edited by Nemi; August 10th, 2005 at 09:41 AM.
    ~Nemi

    Before posting did you try:
    [ Javadocs | Google ]
  2. #2
  3. Feelin' Groovy
    Devshed Supreme Being (6500+ posts)

    Join Date
    Aug 2001
    Location
    WDSMIA
    Posts
    10,135
    Rep Power
    5053
    Excellent! Now we don't have to have "PHP Code:" preceding our Java examples just to get the pretty colors...

    Thanks!
    Yawmark
    class Sig{public static void main(String...args){\u0066or(int
    \u0020$:"v\"ʲ\"vΤ\"".to\u0043h\u0061rArray()
    )System./*goto/*$/%\u0126//^\u002A\u002Fout.print((char)(($>>
    +(~'"'&'#'))+('<'>>('\\'/'.')/\u002Array.const(~1)\*\u002F)));}}
  4. #3
  5. Daniel Schildsky
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2004
    Location
    KL, Malaysia.
    Posts
    1,540
    Rep Power
    1621

    Great!


    Great! This little piece of tool is really convenient!
    But for SQL, does it support all variations of sql?
    When the programming world turns decent, the real world will turn upside down.
  6. #4
  7. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    But for SQL, does it support all variations of sql?
    I have no idea. Try it and see!
    ~Nemi

    Before posting did you try:
    [ Javadocs | Google ]
  8. #5
  9. Come to the door. . .
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2004
    Location
    Ohio
    Posts
    814
    Rep Power
    197
    Very nice.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2008
    Location
    In your head....
    Posts
    556
    Rep Power
    993
    This highlighter is brilliant its almost like gishi hightlighter! Which I have been using on a number of my blogs for a couple of months now.

    It does make the code look a lot nicer!
    --------===============--------
    I host my website with: EUKHOST
    Blogging and SEO Tips
    FOLLOW ME ON TWITTER @matthew_seymour
  12. #7
  13. Santosh Vaza
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2010
    Location
    JHome
    Posts
    356
    Rep Power
    13
    it makes code eaiser to read and understand
    1 question..
    Does it automatically formats the code????
  14. #8
  15. Feelin' Groovy
    Devshed Supreme Being (6500+ posts)

    Join Date
    Aug 2001
    Location
    WDSMIA
    Posts
    10,135
    Rep Power
    5053
    Does it automatically formats the code????
    No.

    ~
    Yawmark
    class Sig{public static void main(String...args){\u0066or(int
    \u0020$:"v\"ʲ\"vΤ\"".to\u0043h\u0061rArray()
    )System./*goto/*$/%\u0126//^\u002A\u002Fout.print((char)(($>>
    +(~'"'&'#'))+('<'>>('\\'/'.')/\u002Array.const(~1)\*\u002F)));}}
  16. #9
  17. Santosh Vaza
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2010
    Location
    JHome
    Posts
    356
    Rep Power
    13
    Originally Posted by Yawmark
    No.

    ~
    Hmmm
  18. #10
  19. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,214
    Rep Power
    1469
    Love the necro, but I think we've exhausted the topic. lol

    Thread closed.

    Comments on this post

    • Yawmark agrees
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!

IMN logo majestic logo threadwatch logo seochat tools logo