Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSX and TSX lexers treat custom HTML elements as invalid syntax #2056

Open
justinbhopper opened this issue Jun 21, 2024 · 0 comments
Open

JSX and TSX lexers treat custom HTML elements as invalid syntax #2056

justinbhopper opened this issue Jun 21, 2024 · 0 comments
Assignees
Labels
bugfix-request A request for a bugfix to be developed.

Comments

@justinbhopper
Copy link

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 justinbhopper added the bugfix-request A request for a bugfix to be developed. label Jun 21, 2024
@tancnle tancnle self-assigned this Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed.
Projects
None yet
Development

No branches or pull requests

2 participants