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

Ruby lexer bug: `:|` in `f { |x:| }` mistakenly interpreted as a symbol #1960

Open UlyssesZh opened 1 year ago

UlyssesZh commented 1 year ago

Name of the lexer

Ruby.

Code sample

f { |x:| }

In this example, x: is a keyword argument whose default value is not provided. However, Rouge's Ruby lexer regarded :| as a symbol.