Closed calebdw closed 1 year ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Added option --indent-inner-html
and --extra-liners
at https://github.com/shufo/prettier-plugin-blade/releases/tag/v1.11.0
$ yarn run -s prettier __tests__/fixtures/runtimeConfig/indentInnerHtml/index.blade.php --indent-inner-html --extra-liners
<html>
<head>
@section('header')
<title>
foo
</title>
@endsection
</head>
<body>
<button className="prettier-class" id="prettier-id" onClick={this.handleClick}>
Click Here
</button>
</body>
</html>
prettier config will be like
{
"overrides": [
{
"files": ["*.blade.php"],
"options": {
"tabWidth": 4,
"parser": "blade"
}
}
],
"printWidth": 120,
"tabWidth": 4,
"indentInnerHtml": true,
"extraLiners": ""
}
Version
1.10.0
Template before formatting
Template after formatting
Expected Behaviour
Hello!
The plugin is messing up the indentation of the html,
head
andbody
should be indented and there shouldn't be newlines between the tags.For reference, here is the same text formatted in a
test.html
file (using the defaulthtml
parser, also note thedoctype
is converted to lower case):Perhaps it would be possible/easier to reuse the functionality from the default prettier
html
parser?Thanks!
Relevant log output
No response