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

Html comments are not supported #5

Open
odinhb opened this issue Mar 12, 2024 · 4 comments
Open

Html comments are not supported #5

odinhb opened this issue Mar 12, 2024 · 4 comments

Comments

@odinhb
Copy link
Collaborator

odinhb commented Mar 12, 2024

If you put this in your code:

<!-- this is a html comment -->

Most some tools will choke on it. Here is esbuild:

✘ [ERROR] Expected identifier but found "!"

Also mentioned here: developit#15

@odinhb
Copy link
Collaborator Author

odinhb commented Mar 12, 2024

I'm thinking this could be supported as part of the transformation if the package was redone as a compiler plugin.

@odinhb
Copy link
Collaborator Author

odinhb commented Mar 12, 2024

wongchichong's fork seems to support html comments in some form, but I don't think this will work with most tools? I'm not confident enough to pull it in anyway.

developit#39

@odinhb
Copy link
Collaborator Author

odinhb commented Mar 12, 2024

Note: comments are supported in jsx, but they don't appear in the output and look like this:

{/*this is a javascript comment*/}

@jcubic
Copy link

jcubic commented Apr 29, 2024

Note that <!-- comments --> are invalid JSX, so none of the JSX libraries support such syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants