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

Respect Prettier's behaviour for self closing elements #328

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Princesseuh
Copy link
Member

Changes

Blocked by withastro/compiler#716

Prettier has a.. interesting behaviour regarding self-closing in that.. it doesn't actually respect the HTML spec...

Instead, it'll use whatever the user specified (so, <div /> will stay as is, despite being invalid HTML) unless the user hasn't explicitly closed the tag (ex: <div>), in which case it'll do whatever the spec says.

Very confusing, but even more so confusing for users used to the behaviour Prettier usually has. This PR makes it so it follows Prettier's behavior.

Fix #325

Testing

Tests already cover this!

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2023

🦋 Changeset detected

Latest commit: 6dcdcbc

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

@u3u
Copy link

u3u commented Oct 12, 2023

When can it be merged?

@Princesseuh
Copy link
Member Author

When can it be merged?

When it's not blocked by the compiler issue anymore

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

Successfully merging this pull request may close these issues.

🐛 BUG: Prettier is expanding self closing empty tags into its full form
2 participants