rouge-ruby / rouge

A pure Ruby code highlighter that is compatible with Pygments
https://rouge.jneen.net/
Other
3.35k stars 739 forks source link

Support JavaScript ES6 syntax highlighting #432

Open timkendrick opened 8 years ago

timkendrick commented 8 years ago

Now that ES6/ES2015 is commonplace in the JS world, is there a way we can support the new syntax additions? At the moment, valid ES6 code is full of .err classes when I run it through Rouge.

ES6 is backwards-compatible with existing javascript, so I imagine this would just be a case of adding more rules – however I know nothing about lexers so I could well be wrong about this…

Thanks!

leftstick commented 8 years ago

Same issue, is there something like configuration to enable ES2015 syntax?

jackfranklin commented 8 years ago

This has really hit me, especially now GitHub pages use Rouge by default. Are there any plans to enable some of this syntax being supported? I'd love to contribute but I'm not sure my knowledge is good enough :(

hzhu commented 8 years ago

Same, since Jekyll is based on rouge, no body in the world who blogs about ES2015/16 has support. 😿

Let's get this merged?

jneen commented 8 years ago

Yes! I would love to support this.

graingert commented 7 years ago

probably worth jumping straight to ES2018 and maybe even some proposed extensions:

async function* foo() {
  await bar;
  yield ham;
  await baz;
  yield *spam;
}
stale[bot] commented 5 years ago

This contribution has been automatically marked as stale because it has not had any activity for more than a year. It will be closed if no additional activity occurs within the next 14 days.

pyrmont commented 5 years ago

Hi, I recently joined the project as a maintainer. Looking through the merged PRs, it appears that there are a number of ES6-specific PRs that have been merged in.

Could someone with more knowledge of JavaScript than me let me know where we are with this support?