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

时间:2020-09-02 15:10:12

标签: html visual-studio-code vscode-settings

我有以下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 完整性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`使用VS代码的自动格式化程序时,但根据文档,仅有四个设置是:

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属性包装到另一行吗?

1 个答案:

答案 0 :(得分:0)

您应该可以选择preservepreserve-aligned

enter image description here