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

fix: hug when needed for components and fragments #397

Merged
merged 3 commits into from
Dec 27, 2023

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Dec 26, 2023

Changes

Previously, components, fragments and custom elements were considered to be block elements, this is kinda incorrect as they're all whitespace sensitive by default.

In the future, a better way would be to be CSS-based, like Prettier itself is. But that's a much larger refactor.

Fix #352

Testing

Updated tests for this

Docs

N/A

Copy link

changeset-bot bot commented Dec 26, 2023

🦋 Changeset detected

Latest commit: 3b28717

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
prettier-plugin-astro Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

<body>
...
</body>
<body> ...</body>
Copy link
Member Author

@Princesseuh Princesseuh Dec 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am aware that this is incorrect. However, it requires implementing something we don't have at all right now: the ability for certain elements to have forced break between their children (body, head, td etc works like that)

This only (partially) worked before by accident

@Princesseuh Princesseuh merged commit e97406a into main Dec 27, 2023
@Princesseuh Princesseuh deleted the fix/component-inline branch December 27, 2023 18:48
@catdevnull
Copy link

When is this getting tagged? This is kinda annoying

@Princesseuh
Copy link
Member Author

When is this getting tagged? This is kinda annoying

Will do tomorrow, sorry for the delay! I didn't want to release this right when I merged because we were still in the holidays for most of the team, but it should've been done last week and I forgot.

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

Successfully merging this pull request may close these issues.

🐛 BUG: Formatter results in unwanted whitespace
3 participants