-
Notifications
You must be signed in to change notification settings - Fork 59
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 Comment causing <body> to render no class/attributes #945
Comments
@poximy I opened the reproduction, and I can't see any error. What should I do to reproduce the issue? |
Hello @poximy. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
@ematipico Notice how line 13 has a class (text-red-500), and at line 19 it's declared inside the style tag. Well you should see in the output "Astro" in red. But this does not happen. When you remove the comment on line 5 and refresh. The text will now be in red. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Firefox, Safari
Describe the Bug
This code will Render perfectly without the JSX comment on a
.astro
When a comment (JSX comment) is present after the Component Script and before the start of any html tag, when rendered in dev and preview mode. For its class attribute and anything in side it will be removed. But if
{title}
is removed and<title>Astro</title>
is in its place this will render properly. Short hand attributes like<meta {charset} />
will work perfectly.A solution I found was just to use a simple html comment, or use a JSX comment and wrap the title in a Fragment:
What's the expected result?
This is how it should be rendered regardless of a JSX comment position:
Not:
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-zmz8ku?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: