prettier-plugin-astro icon indicating copy to clipboard operation
prettier-plugin-astro copied to clipboard

🐛 BUG: HTML formatting exception: </html> tag output error

Open SharpIceX opened this issue 6 months ago • 2 comments

Describe the Bug

Example cdoe:

<html>
  <head></head>
  <body></body>
</html>

Formatting Results:

<html>
  <head></head>
  <body></body></html
>

Steps to Reproduce

.prettierrc.json:

{
  "htmlWhitespaceSensitivity": "strict",
  "plugins": ["prettier-plugin-astro"]
}

This problem occurs when prettier's htmlWhitespaceSensitivity is configured as strict

SharpIceX avatar Jun 07 '25 16:06 SharpIceX

i have the same issue , any solution? The problem occurs with both strict and css . ignore works fine

kishore-FDI avatar Jun 21 '25 10:06 kishore-FDI

i have the same issue , any solution? The problem occurs with both strict and css . ignore works fine

Temporary fix:

{
	"htmlWhitespaceSensitivity": "strict",
	"plugins": ["prettier-plugin-astro"],
	"overrides": [
		{
			"files": "*.astro",
			"options": {
				"htmlWhitespaceSensitivity": "ignore"
			}
		}
	]
}

SharpIceX avatar Jun 21 '25 10:06 SharpIceX