

Completely unfair comparison of JavaScript syntax highlighters - dchest
http://softwaremaniacs.org/blog/2011/05/22/highlighters-comparison/

======
liamk
The unfortunate thing about JS syntax highlighters, is that people reading
your site via an RSS feed don't get the highlighting. On the other hand for
some sites that isn't an issue.

------
jrockway
I hate Javascript syntax highlighting. I have never seen a library that
doesn't degrade horribly in cases like naming a variable x' ("x prime") in
Haskell (or when merely quoting a symbol in Lisp). They also tend not to
support Perl at all, and definitely don't highlight q{Foo} as a string.

My advice is to use Emacs or Vim to do your syntax highlighting. They
highlight well enough to please people actually doing work, and when people
get annoyed with the rules, they fix them.

[http://search.cpan.org/~geoffr/Text-
VimColor-0.11/lib/Text/V...](http://search.cpan.org/~geoffr/Text-
VimColor-0.11/lib/Text/VimColor.pm)

[http://search.cpan.org/~jrockway/Text-
EmacsColor-0.03/lib/Te...](http://search.cpan.org/~jrockway/Text-
EmacsColor-0.03/lib/Text/EmacsColor.pm)

~~~
isagalaev
Highlight.js does support Perl, does mark up q{...} as strings and has no
problem with quoting in Lisp. I'm not sure about Haskell thing you mention
because Haskell is a new contribution. But I'm sure it's fixable if it doesn't
do the right thing.

You're probably talking about a hoard of simplistic regexp parsers.
Highlight.js is not one of them, it's a proper context-aware parser.

------
plasma
<http://ajaxorg.github.com/ace/build/editor.html> is pretty sweet, real time
text editor (many languages) with highlighting support.

See more info at <http://ace.ajax.org/>

------
guard-of-terra
GNU Source Highlight is an amazing thing.

Last time I tried, it mishandled xml elements containing hyphen. Only the part
before the first hyphen was highlighted, the rest was just left as it was.

