WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Site help, bugs, suggestions/questions (https://www.wowinterface.com/forums/forumdisplay.php?f=18)
-   -   WTB Colored Syntax Highlighting in [code] tags (https://www.wowinterface.com/forums/showthread.php?t=19482)

AnduinLothar 11-24-08 01:48 PM

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 ;))

Dolby 11-24-08 06:57 PM

Something like this?

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


[ highlight=lua ]code[ /highlight ]

Fin 11-30-08 04:13 PM

[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?

Shirik 12-01-08 05:35 PM

Quote:

Originally Posted by Fin (Post 111009)
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.

Fin 12-01-08 11:05 PM

Quote:

Originally Posted by Shirik (Post 111154)
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

AnduinLothar 12-11-08 03:49 AM

Love it. Thanks!


All times are GMT -6. The time now is 01:56 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI