The new Syntax Highlighter uses the standard [code] BB-Code with optionally the language specified by using the [code=language-code] syntax.
Basic Usage
If no language-code is specified the Syntax Highlighter will default to using Java. For some forums that deal with specific languages other then standard Java the default will be set to that specific language, for example the JavaFX forum will use "javafx" as default language.
Examples:
[code]public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}[/code]
public static void main(String[] args) {
System.out.println("Hello, World");
}
}[/code]
Java Code:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
[code=java]public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}[/code]
public static void main(String[] args) {
System.out.println("Hello, World");
}
}[/code]
Java Code:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
[code=php]<?php
echo "Hello World.";
?>[/code]
echo "Hello World.";
?>[/code]
PHP Code:
<?php echo "Hello World."; ?>
Optionally you can also give the code block a title by following the language code with a semi-colon (;) and the Title text.
Example:
[code=java;This is the standard Hello World JAVA demo application]public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}[/code]
public static void main(String[] args) {
System.out.println("Hello, World");
}
}[/code]
Java Code: This is the standard Hello World JAVA demo application
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
} You can easily select all the text in a code block by double-clicking anywhere in the code block. In order to copy it to your clipboard, press Ctrl-C (Windows) or Command-C (Mac).
Available Languages
Currently the following language are available. They are listed together with their possible language-codes, use the language-code in the [code=language-code] BB-Codes.
| Brush | Aliases |
| AppleScript | applescript |
| ActionScript3 | as3, actionscript3 |
| Bash | bash, shell |
| Cold Fusion | cf, coldfusion |
| C Sharp | c-sharp, csharp |
| C++ | cpp, c |
| CSS | css |
| Delphi | delphi, pas, pascal |
| Diff | diff, patch |
| Erlang | erl, erlang |
| Groovy | groovy |
| JavaScript | js, jscript, javascript |
| Java | java |
| Java FX | jfx, javafx |
| Perl | perl, pl |
| PHP | php |
| Plain Text | plain, text |
| Power Shell | ps, powershell |
| Python | py, python |
| Ruby On Rails | ruby, rails, ror |
| SASS | sass |
| Scala | scala |
| SQL | sql |
| Visual Basic | vb, vbnet |
| XML | xml, xhtml, xslt, html |
Known limitations:
In the current version a code block will not be syntax highlighted if you use the inline editor to edit a post. After a page refresh the code will show correctly.


vBulletin Message