繁体   English   中英

VS Code 关闭自动格式化程序的 wrapAttributes

[英]VS Code Turn off wrapAttributes for auto formatter

我有以下 html 代码:

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css"
    integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">

每当我通过按shift+Alt+f", it just wraps the使用 VS 代码的自动格式化程序时shift+Alt+f", it just wraps the完整性attribute to the next line. I would like to keep everything on one line. I did some research, and found out the setting that control it is shift+Alt+f", it just wraps the attribute to the next line. I would like to keep everything on one line. I did some research, and found out the setting that control it is html.format.wrapAttributes`,但根据文档,只有四个设置是:

auto: Wrap when the line length is exceeded
force: Wrap all attributes, except first
force-aligned: Wrap all attributes, except first, and align attributes
force-expand-multiline: Wrap all attributes

没有设置可以关闭它。 我试图将它设置为"html.format.wrapAttributes": false"html.format.wrapAttributes": "" 他们没有帮助。

我想知道如何设置 VS 代码,以便每次使用 VS 代码 HTML 自动格式化程序时,它不再将integrity属性包装到另一行?

您应该能够选择preservepreserve-aligned

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM