[英]How to prevent a line break to every html element end tag using VSCode Prettier?
This what I currently have on my Editor.这是我目前在我的编辑器上拥有的。 This is actually a laravel blade, so the filename is
page.blade.php
.这实际上是一个 Laravel Blade,所以文件名是
page.blade.php
。 However, I added these on the files.associate
;但是,我在
files.associate
上添加了这些;
"*.blade.php":"html"
<nav
class="navbar navbar-standard navbar-expand-lg fixed-top navbar-dark navbar-theme"
>
<div class="container">
<a class="navbar-brand" href="../index.html"
><span class="text-white">{{ config("app.name") }}</span></a
>
<button
class="navbar-toggler collapsed"
type="button"
data-toggle="collapse"
data-target="#navbarStandard"
aria-controls="navbarStandard"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
So if you notice on the snippet, the >
is always breaking the line and it's not good.因此,如果您注意到代码片段,
>
总是打破界限,这并不好。 especially on the </a>
tag.特别是在
</a>
标签上。 I tried editing the HTML>Format: Wrapp Attributes
, but it's not working, see picture attached:我尝试编辑
HTML>Format: Wrapp Attributes
,但它不起作用,见附图:
Now this is what I want.现在这就是我想要的。
<nav class="navbar navbar-standard navbar-expand-lg fixed-top navbar-dark navbar-theme">
<div class="container">
<a class="navbar-brand" href="../index.html">
<span class="text-white">Logo</span>
</a>
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarStandard" aria-controls="navbarStandard" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.