rouge-ruby / rouge

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

Fix python call syntax highlighting #1987

Open pencels opened 1 year ago

pencels commented 1 year ago

Summary

Fixes an issue with the Python lexer where any identifier used before an opening paren ( would be highlighted as a function name. This led to inconsistent highlighting in the case of for loops, where one for would be rendered as a keyword while the other was rendered as a function name:

image

This pull request also addresses other edge cases for call expressions:

Visual Before and After

Before After
Screenshot 2023-08-20 132415 Screenshot 2023-08-20 132000