Syntax coloring code in JavaScript

Monday 3 January 2005

Alex Gorbatchev has another solution to the problem of syntax-coloring code snippets on blogs: ship the whole problem over to the browser, then do the coloring in JavaScript. It's a very interesting solution, and the JavaScript code itself is very cool.

What I need is syntax coloring that can handle true Unicode characters. I don't know whether JavaScript regexes can do it. I've been using SilverCity, but have been thinking about a new solution. Maybe client-side JavaScript is the way to go.

Comments

Add a comment:

name
email
Ignore this:
not displayed and no spam.
Leave this empty:
www
not searched.
 
Name and either email or www are required.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.