rouge-ruby / rouge

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

TSX: Type args to generic components not recognized #1833

Closed intgr closed 2 years ago

intgr commented 2 years ago

Name of the lexer TSX

Code sample

Type arguments to generic components are not recognized by Rouge.

const render = () => (
    <MyComponent attr={value} foo="bar" />
);

const render2 = () => (
    <MyComponent<Type> attr={value} foo="bar" />
    //          ^^^^^^ unhandled syntax
);

Notice that the highlighting of the attributes following the type arg are dfferent in the top and bottom examples.

http://rouge.jneen.net/v3.29.0/tsx/Y29uc3QgcmVuZGVyID0gKCkgPT4gKAogICAgPE15Q29tcG9uZW50IGF0dHI9e3ZhbHVlfSBmb289ImJhciIgLz4KKTsKCmNvbnN0IHJlbmRlcjIgPSAoKSA9PiAoCiAgICA8TXlDb21wb25lbnQ8VHlwZT4gYXR0cj17dmFsdWV9IGZvbz0iYmFyIiAvPgogICAgLy8gICAgICAgICAgXl5eXl5eIHVuaGFuZGxlZCBzeW50YXgKKTsK

image