Thread Tools Display Modes
11-24-08, 01:48 PM   #1
AnduinLothar
Nobody of Importance
 
AnduinLothar's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 95
WTB Colored Syntax Highlighting in [code] tags

I'm sure there's a forum plugin for syntax highlighting. I expect we only really need Lua and XML coloring, but maybe Java, Python and HTML if you're feeling ambitious.

Was just trying to put some code tags in my library descriptions and found that it's really hard to read.

Might also me interesting if there were a macro syntax highlighting, but you'd most likely have to write the format yourself (or get cladhaire to do it )
  Reply With Quote
11-24-08, 06:57 PM   #2
Dolby
PPAP
 
Dolby's Avatar
WoWInterface Admin
Join Date: Feb 2004
Posts: 2,341
Something like this?

lua Code:
  1. function HelloWorld()
  2.   message("Hello World!");
  3. end


[ highlight=lua ]code[ /highlight ]
  Reply With Quote
11-30-08, 04:13 PM   #3
Fin
An Aku'mai Servant
 
Fin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 34
Thumbs down

[quote=AnduinLothar;110376]I'm sure there's a forum plugin for syntax highlighting.QUOTE]

There is indeed:

- http://www.vbulletin.org/forum/showthread.php?t=93071

It's based on GeSHi:

-http://qbnz.com/highlighter/

which supports, well, everything. Apparently the plugin is quite slow for large code blocks (200K+ of text), but maybe it'd still be suitable for use in the WoWi forums?
  Reply With Quote
12-01-08, 05:35 PM   #4
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
Originally Posted by Fin View Post
which supports, well, everything. Apparently the plugin is quite slow for large code blocks (200K+ of text), but maybe it'd still be suitable for use in the WoWi forums?
Unfortunately that can translate into being a very dangerous DoS vulnerability for a site that has as many hits as this one.

I don't see any reason to support languages beyond Lua and XML here, honestly.
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/
  Reply With Quote
12-01-08, 11:05 PM   #5
Fin
An Aku'mai Servant
 
Fin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 34
Originally Posted by Shirik View Post
Unfortunately that can translate into being a very dangerous DoS vulnerability for a site that has as many hits as this one.

I don't see any reason to support languages beyond Lua and XML here, honestly.
Sure, possibly - anything that uses more than its fair share of resources equates to a DoS really; but I'd say it was probably worth testing at least? (It might even have an option to limit the amount of code it'll highlight?)

Anyway, just an suggestion - and response to the original poster!

cheers,

- Fin
  Reply With Quote
12-11-08, 03:49 AM   #6
AnduinLothar
Nobody of Importance
 
AnduinLothar's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 95
Love it. Thanks!
  Reply With Quote

WoWInterface » Site Forums » Site help, bugs, suggestions/questions » WTB Colored Syntax Highlighting in [code] tags


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off