VSCode 在 html 代码的结束标记中添加空格和斜杠,如何禁用它? [英] VSCode is adding space and slash in ending tag of html code, how can I disable it?
本文介绍了VSCode 在 html 代码的结束标记中添加空格和斜杠,如何禁用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在html文件中,如果我用
In html file, if I save file with
<br>
变成...
<br />
我只想要第一个没有斜线和空格的,我该怎么做?(如果是这个原因,我会使用 Prettier)
I just want first one without slash and space, how can I do it? (I use Prettier if that's the reason)
推荐答案
找到了解决方案,Prettier 就是问题所在.我想要的是
去掉 HTML 文件中不必要的斜线,但在其他文件(如 js、python...)上保留自动格式...
Found the solution, Prettier was the problem.
What I wanted is to
get rid of unnecessary slashes in HTML files, but leave auto formatting on other files like js, python...
我所做的是...
- 转到设置 (cmd + ,)
- 搜索更漂亮
- 在禁用语言部分添加html"(不带双引号)
问题解决了!
这篇关于VSCode 在 html 代码的结束标记中添加空格和斜杠,如何禁用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文