rubychan / coderay

Fast and easy syntax highlighting for selected languages, written in Ruby.
http://coderay.rubychan.de/
Other
846 stars 115 forks source link

Ruby syntax highlighting failures #209

Open ylluminate opened 7 years ago

ylluminate commented 7 years ago

The following provides results and an example of how Ruby is not being syntactically highlighted properly: http://idiosyncratic-ruby.com/1-test-highlights.html

korny commented 7 years ago

Test case 1 is the problem here; CodeRay thinks the last part is a Symbol. Here's a minimal test case.

a?'b':c

Unfortunately, this isn't easy to fix. I tried to improve colon/Symbol detection in the past, and the current implementation is a result of these efforts. It works really well for a lot of cases, especially code that uses spaces correctly ;)