rubychan / coderay

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

Javascript ES6 Support #200

Open nathanemyers opened 8 years ago

nathanemyers commented 8 years ago

Is there support planned for adding ES6 keywords and highlighting for javascript? The only egregious error I've noticed so far is in parsing backtick string blocks such as:

`Hello, my name is ${name}.`

Thanks!

korny commented 7 years ago

Very reasonable request. I will put it on the list for 1.2.

tigarcia commented 7 years ago

Hi any news on when this change might come out? I'm willing to help with the code, but I would probably need some advice on where to get started.

korny commented 7 years ago

Not working on scanners at the moment. The future of CodeRay might be the rewrite of the scanner engine. It's just too difficult to write them right now, that's why Rouge has long passed CodeRay in terms of supported languages.

But it should be easy to tweak existing scanners. For this one, you just need to add new rules to https://github.com/rubychan/coderay/blob/master/lib/coderay/scanners/java_script.rb. There's also a short guide on writing Scanners that might be helpful.

ghost commented 2 years ago

Any news on this? It's been over 5 years, ES6 (and newer versions) are pretty ubiquitous now.