Skip to content

Respect Prettier's behaviour for self closing elements#328

Open
Princesseuh wants to merge 2 commits into
mainfrom
feat/respect-prettier-html-closing
Open

Respect Prettier's behaviour for self closing elements#328
Princesseuh wants to merge 2 commits into
mainfrom
feat/respect-prettier-html-closing

Conversation

@Princesseuh

Copy link
Copy Markdown
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

changeset-bot Bot commented Feb 6, 2023

Copy link
Copy Markdown

🦋 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

u3u commented Oct 12, 2023

Copy link
Copy Markdown

When can it be merged?

@Princesseuh

Copy link
Copy Markdown
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