简体   繁体   中英

VS Code Turn off wrapAttributes for auto formatter

I have the following html codes:

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

Whenever I use VS code's auto formatter by pressing shift+Alt+f", it just wraps the integrity 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`, but according to the documentation, the only four settings are:

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

There is no setting to turn it off. I have tried to set it up as "html.format.wrapAttributes": false and "html.format.wrapAttributes": "" . They do not help.

I am wondering how to setup VS code such that every time I use VS code HTML auto formatter, it does not wrap integrity attribute to another line anymore?

You should be able to choose preserve or preserve-aligned .

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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