Using Syntax Highlighting in posts

1 reply [Last post]
Zugg
Zugg's picture
Joined: Jan 1 1999
Posts: 178
Using Syntax Highlighting in posts
These forums now support syntax highlighting within the editor.  To insert code, click the CODE button in the editor toolbar above and paste your code.  You can select which language you want to use in the popup dialog.  Here is an example where I inserted some zScript code:
#show %ansi(red)"testing"
#if (@var > 123) {
  $local = "string" // comment here
  }
You can also use normal CODE tags from BBcode.  Here is the same code above inserted into CODE tags:
#show %ansi(red)"testing"
#if (@var > 123) {
  $local = "string" // comment here
  }

Cool stuff!
Zugg
Zugg's picture
Joined: Jan 1 1999
Posts: 178
Here is another test where we embed < and &lt; symbols into the code (example is PHP):
$code_tag[1] = str_replace(array('<', '>'), array('&lt;', '&gt;'), $code_tag[1]);
This will solve a lot of issues that people were having with the old forums.