My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 449: Syntax highlighting is pretty bad
2 people starred this issue and may be notified of changes. Back to list
Status:  Duplicate
Merged:  issue 251
Owner:  ----
Closed:  Feb 2010


Sign in to add a comment
 
Reported by mike.lifeguard@gmail.com, Feb 13, 2010
Affected Version: 2.1.1
Environment: Ubuntu (karmic)

What steps will reproduce the problem?
1. View any diff

I expect semi-correct syntax highlighting. Instead, I see incorrect and
ugly syntax highlighting. Please consider using a better syntax highlighter
and provides highlighting appropriate for the language being highlighted.

Suggested options:
*GeSHi: http://qbnz.com/highlighter/
*Pygments: http://pygments.org/
Feb 13, 2010
#1 sop@google.com
There are some bugs in the syntax highlighting implementation.
A few were fixed in trunk and are expected to be released in
2.1.2... but its too slow now (see  issue 439 ).

GeSHi won't work, its written in PHP.  There is no PHP engine
on Java available.

Pygments won't work, its too slow.  While fixing  issue 251  I
tried to switch to Pygments in Jython and its even slower than
what I currently have checked in.
Status: Duplicate
Mergedinto: 251
Feb 13, 2010
#2 mike.lifeguard@gmail.com
How embarassing is it that I forgot it had to be in java :D

Are you just writing your own syntax highlighter? One would think there'd be a good
one in java already written :\
Feb 13, 2010
#3 sop@google.com
There really aren't any good ones available in Java.

Eclipse and IntelliJ both have good syntax highlighters for quite a
few common languages... but they are very integrated into their UIs  
and their plugin architectures.  Reusing just the highlighter logic
would require dragging in a ton of extra code we don't care about.
It might also be really hard to do in a headless server environment
since the code was built for, and largely assumes, an AWT or SWT   
UI that its working on.
 
I don't want to write one from scratch.  Its a giant pain in the a**
to write and as you can see, we have plenty of other open issues 
that also need attention.  But I'm starting to consider porting
Pygments to Java.  But again, its a giant pain in the a** to port
Python code.  It would be better if we didn't have to do that.

So right now, I'm sort of at a loss.  I might just reopen  issue 251 
and put back the current broken code and defer this until later.
Feb 15, 2010
#4 mike.lifeguard@gmail.com
So, if this is a duplicate of 251, shouldn't it be re-opened?
Jan 20, 2012
#5 annu...@gmail.com
Perl highlighting is awful - it fails to parse regexps and all following code is treated as a one big comment
Dec 19, 2012
#6 mai...@jamesfry.com
Could this be done client side with prettify? https://code.google.com/p/google-code-prettify/
Sign in to add a comment

Powered by Google Project Hosting