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 inner HTML tags #14565

Closed
ElHyperion opened this issue Mar 22, 2023 · 1 comment
Closed

Don't indent inner HTML tags #14565

ElHyperion opened this issue Mar 22, 2023 · 1 comment
Labels
lang:html Issues affecting HTML (and SVG but not JSX) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Comments

@ElHyperion
Copy link

ElHyperion commented Mar 22, 2023

Prettier 2.8.6
Playground link

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:
Indenting and should be optional. Prettier currently unnecessarily indents the whole HTML file which restricts a lot of horizontal space for body and head tag contents, with no option to control this behaviour

For example, a Prettier option "indent_inner_html" could be added.

Issue where this has been already discussed previously, with no response but positive feedback from the community: #12348

@sosukesuzuki sosukesuzuki added the lang:html Issues affecting HTML (and SVG but not JSX) label Mar 25, 2023
@sosukesuzuki
Copy link
Member

We cannot add option for this issue. Please see https://prettier.io/docs/en/option-philosophy.html
Also I don't think we will never add support for this format. Our apologies.

@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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:html Issues affecting HTML (and SVG but not JSX) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

2 participants