rouge icon indicating copy to clipboard operation
rouge copied to clipboard

JSX and TSX lexers treat custom HTML elements as invalid syntax

Open justinbhopper opened this issue 8 months ago • 0 comments

Name of the lexer jsx and tsx

Code sample

<my-custom-element foo="bar">
  Hello world
</my-custom-element>

image

https://rouge.jneen.net/v4.3.0/tsx/Y29uc3QgSGVsbG9Xb3JsZCA9ICgpID0-IHsKICByZXR1cm4gKAogICAgPG15LWN1c3RvbS1lbGVtZW50IGZvbz0iYmFyIj4KICAgICAgSGVsbG8gd29ybGQKICAgIDwvbXktY3VzdG9tLWVsZW1lbnQ-CiAgKTsKfQo

Additional context The hyphen in custom elements are treated as invalid syntax in JSX/TSX lexers. Custom HTML elements require a hyphen.

Surprisingly, the html lexer does not have this issue.

justinbhopper avatar Jun 21 '24 21:06 justinbhopper