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: Fix an issue where some keywords like "for" and "if" are mistakenly recognized as functions #1938

Closed nsfisis closed 1 year ago

nsfisis commented 1 year ago

It fixes #1934. Some keywords like for and if in JavaScript are mistakenly recognized as functions.

Check if the matched function name is one of the keywords or not.

tancnle commented 1 year ago

Thank you for your contribution @nsfisis ❤️ The changes look good to me! 🚀