如何让 Prettier 将结束标记的结束符号保持在同一行
How to get Prettier to keep ending symbol of ending tag on the same line
出于某种原因,当我使用这样的 emmet 缩写时:
div>button.round-button+button>i.fas.fa-icons
然后我保存文件以触发 Prettier 格式化程序,它将像这样格式化:
<div>
<button class="round-button"></button
><button><i class="fas fa-icons"></i></button>
</div>
但是,在第三行,我不希望该行以第一个按钮标记的末尾开始
我快速浏览了设置,但没有找到任何与此相关的内容。是否有我可以更改的设置,或者最好向 Prettier 提供反馈?
在 button
标签之间添加空格是不安全的。它会影响浏览器中的输出。如果需要,请手动添加此空格;如果您不关心格式的安全性,请使用 the htmlWhitespaceSensitivity
option。
出于某种原因,当我使用这样的 emmet 缩写时:
div>button.round-button+button>i.fas.fa-icons
然后我保存文件以触发 Prettier 格式化程序,它将像这样格式化:
<div>
<button class="round-button"></button
><button><i class="fas fa-icons"></i></button>
</div>
但是,在第三行,我不希望该行以第一个按钮标记的末尾开始
我快速浏览了设置,但没有找到任何与此相关的内容。是否有我可以更改的设置,或者最好向 Prettier 提供反馈?
在 button
标签之间添加空格是不安全的。它会影响浏览器中的输出。如果需要,请手动添加此空格;如果您不关心格式的安全性,请使用 the htmlWhitespaceSensitivity
option。