Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Planet Search Overhaul (07/13/24)

Author Topic: Minor Announcement: SyntaxHighlighting now available  (Read 18404 times)

Trylobot

  • Admiral
  • *****
  • Posts: 1170
    • View Profile
    • Github profile
Minor Announcement: SyntaxHighlighting now available
« on: October 01, 2013, 07:24:30 PM »

Thanks to Alex, you may now use

[code=java]your.code.here[/code]

to show syntax highlighted code in a forum post! There are of course other languages available as well. A list of valid syntax aliases is here: http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/
Note that it will not display in the "Preview" mode, but it does work when you really post. It's a known, minor shortcoming of the SMF plugin, but not really important once you know that it works.


Demo:

Code: java
for (int i = 0; i < 100; i++) {
    System.out.println("Test");
}
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24809
    • View Profile
Re: Minor Announcement: SyntaxHighlighting now available
« Reply #1 on: April 22, 2019, 05:03:54 PM »

Update: after the forum upgrade to SMF 2, I've had to switch to a different syntax highlighting mod, Code Highlighting.

The syntax is largely the same, but it doesn't handle //-style comments well (everything after that is treated as a comment), so one has to use /* */ style comments instead.
Logged