New bbcode highlighterWe 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;
}
}