Open patheticGeek opened 4 days ago
I feel this is somewhat expected because Astro's syntax even with JSX-like syntax is still closer to HTML in practice, it's like an HTML templating language. So the different new-line & whitespace rules matches with the HTML behaviour like what's shown here.
but if you think html only has text/nodes not js boundaries in between, and here the spacing is inconsistently applied. it is there between text & jsx but not jsx and jsx or text & text
Also a lot of people use formatters and the formatter automatically makes the spacing decisions for you so ideally it should get minified and new line shouldnt count as a space in this scenario unless explicitly added with {' '}
. or there can be a suggested config for formatter or docs so people dont shoot themselves in foot
--- Our case spfc. things
i am having a lot of issues as this behavior is very unexpected and not like any other jsx syntax, so having a hard time porting code to astro as we have a ton of this kind of components and this adds so much work in porting.
this also has raised some points in our codebase where we just choose making a react component for that one place we couldn't figure how to get consistent spacing with this behavior
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Consider the following code:
It produces produces the following result:
On new line it is adding undesireable spaces b/w jsx and character boundaries but not between jsx and jsx
What's the expected result?
Ideally, there should be no spaces in the above as it should get compressed to
and should get rendered as:
But it is not doing that
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-gwdsqj?file=src%2Fpages%2Findex.astro
Participation