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

Don't indent <head> & <body> #12348

Closed
nitin2953 opened this issue Feb 22, 2022 · 3 comments
Closed

Don't indent <head> & <body> #12348

nitin2953 opened this issue Feb 22, 2022 · 3 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:awaiting response Issues that require answers to questions from maintainers before action can be taken

Comments

@nitin2953
Copy link

nitin2953 commented Feb 22, 2022

Prettier 2.5.1
Playground link

--parser html
--use-tabs

Input:

<!DOCTYPE html>
<html lang="en-IN">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<title>Company</title>
</head>
<body>
	<header>Company</header>
	<main>
		<h1>Heading</h1>
	</main>
	<footer>© Company</footer>
</body>
</html>

Output:

<!DOCTYPE html>
<html lang="en-IN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<title>Company</title>
	</head>
	<body>
		<header>Company</header>
		<main>
			<h1>Heading</h1>
		</main>
		<footer>© Company</footer>
	</body>
</html>

Expected behavior:

<!DOCTYPE html>
<html lang="en-IN">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<title>Company</title>
</head>
<body>
	<header>Company</header>
	<main>
		<h1>Heading</h1>
	</main>
	<footer>© Company</footer>
</body>
</html>

On smaller *viewport* width,
indenting <head> & <body> Only create unnecessary overflow

That extra whitespace might be OKAY if you have wider viewport width
BUT not for majority of others
 
---
A Prettier option "indent_inner_html" with default value false is what we want
---

@kachkaev
Copy link
Member

Please use one of the issue templates.

@kachkaev kachkaev added the status:awaiting response Issues that require answers to questions from maintainers before action can be taken label Feb 22, 2022
@nitin2953 nitin2953 changed the title Don't indent <head> & <body> 🛑✨ Don't indent <head> & <body> Feb 23, 2022
@nitin2953 nitin2953 changed the title 🛑✨ Don't indent <head> & <body> 🛑✨ Don't indent <head> & <body>  👍 👎 Feb 25, 2022
@fisker fisker changed the title 🛑✨ Don't indent <head> & <body>  👍 👎 Don't indent <head> & <body> Feb 25, 2022
@Abd-Ur-Rehman

This comment was marked as spam.

@no-response
Copy link

no-response bot commented Mar 8, 2022

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Mar 8, 2022
@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jun 7, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:awaiting response Issues that require answers to questions from maintainers before action can be taken
Projects
None yet
Development

No branches or pull requests

3 participants