rouge-ruby / rouge

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

JavaScript: Some keywords like "for" and "if" are mistakenly recognized as functions. #1934

Closed HeySora closed 1 year ago

HeySora commented 1 year ago

Name of the lexer Javascript

Code sample

if (something)
{
    console.log('something');
}

Additional context if is mistakenly being treated as a function due to the parenthesis next to it.

The same happens to for, while, switch, and other keywords requiring a pair of parenthesis after.

Here is a preview with keywords in red, and functions in cyan: image