views:

101

answers:

3

Hello,

I am looking for a good automatic syntax highlighter for self-hosted WordPress blog (not wordpress.com blog). It would be great if the syntax highlighter automatically detects code parts and highlights them.

Thanks in advance.

+2  A: 

Google Code Prettify is a fairly standard syntax highlighter, and there are multiple wordpress plugins that use it. Here's an example of one: http://www.deanlee.cn/wordpress/google-code-prettify-for-wordpress/

Amber
+1. I also wrote a tool to help escaping code for it, as the < bracket needs escaping: http://www.stum.de/2008/10/19/escaping-code-for-posting-on-the-website-and-removing-indent/
Michael Stum
+2  A: 

I use Syntax Highlighter Plus for a while now and I'm kinda happy with it.

Ionut Staicu
+1  A: 

Just for anyone else coming to this question after-the-fact (as I did), after much installation/removal of other plug-ins, I settled on SyntaxHighlighter2 because it doesn't require me to go into HTML mode and enter pre tags directly and the syntax is manageable ([code='js']...[/code]). This is one of the many that uses the SyntaxHighlighter 2.0 client-side highlighting script from Alex Gorbatchev (and so if you want server-side, it isn't for you).

T.J. Crowder