Sublimetext3 Sublime 3 HTML格式化程序使用Blade将所有内容都放在了一条新的线上

Sublimetext3 Sublime 3 HTML格式化程序使用Blade将所有内容都放在了一条新的线上,sublimetext3,code-formatting,laravel-blade,Sublimetext3,Code Formatting,Laravel Blade,我正在从事一个Laravel项目,并使用Blade进行模板制作。我的问题是,当我保存文件时,Supreme会将每个HTML标记放在下一行。“保存时自动格式化”处于启用状态。以下是一个例子: <select class="form-control" name="data[month_number]"> <option value="1"> January </option> <option value="2">

我正在从事一个Laravel项目,并使用Blade进行模板制作。我的问题是,当我保存文件时,Supreme会将每个HTML标记放在下一行。“保存时自动格式化”处于启用状态。以下是一个例子:

<select class="form-control" name="data[month_number]">
    <option value="1">
        January
    </option>
    <option value="2">
        February
    </option>
    <option value="3">
        March
    </option>
    <option value="4">
        April
    </option>
    <option value="5">
        May
    </option>
    <option value="6">
        June
    </option>
    <option value="7">
        July
    </option>
    <option value="8">
        August
    </option>
    <option value="9">
        September
    </option>
    <option value="10">
        October
    </option>
    <option value="11">
        November
    </option>
    <option value="12">
        December
    </option>
</select>

一月
二月
前进
四月
也许
六月
七月
八月
九月
十月
十一月
十二月
鉴于它应该是:

<select class="form-control" name="data[month_number]">
    <option value="1">January</option>
    <option value="2">February</option>
    ....
</select>

一月
二月
....
以下是我的HTML代码格式化程序设置:

"codeformatter_html_options": {
    "syntaxes": "html,blade,asp,xml,php", // Syntax names which must process HTML formatter
    "format_on_save": true, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$"
    "formatter_version": "bs4", // Which formatter to use. Current options are "bs4" and "regexp". If an error occurs while loading the bs4 formatter, the regexp formatter will automatically be used
    "indent_size": 4, // indentation size
    "indent_char": " ", // Indentation character
    "indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
    "exception_on_tag_mismatch": false, // If the last closing tag is not at the same indentation level as the first opening tag, there's probably a tag mismatch in the file
    "expand_javascript": false, // (Under construction) Expand JavaScript inside of <script> tags (also affects CSS purely by coincidence)
    "expand_tags": false, // Expand tag attributes onto new lines
    "minimum_attribute_count": 2, // Minimum number of attributes needed before tag attributes are expanded to new lines
    "first_attribute_on_new_line": false, // Put all attributes on separate lines from the tag (only uses 1 indentation unit as opposed to lining all attributes up with the first)
    "preserve_newlines": true, // whether existing line breaks should be preserved,
    "max_preserve_newlines": 2, // maximum number of line breaks to be preserved in one chunk
    "reduce_empty_tags": false, // Put closing tags on same line as opening tag if there is no content between them
    "reduce_whole_word_tags": false, // Put closing tags on same line as opening tag if there is whole word between them
    "custom_singletons": "" // Custom singleton tags for various template languages outside of the HTML5 spec
},
“codeformatter\u html\u选项”:{
“语法”:“html、blade、asp、xml、php”//必须处理html格式化程序的语法名称
“保存时格式化”:true,//保存时格式化。在文件名上测试布尔值(true/false)或字符串regexp。例如:“^((?!.min.|供应商)。*$”
“formatter_version”:“bs4”,//使用哪个格式化程序。当前选项为“bs4”和“regexp”。如果加载bs4格式化程序时出错,将自动使用regexp格式化程序
“缩进大小”:4,//缩进大小
“缩进字符”:“”//缩进字符
“使用选项卡缩进”:false,//使用一个选项卡缩进(覆盖缩进大小和缩进字符选项)
“exception_on_tag_mismatch”:false,//如果最后一个结束标记与第一个开始标记不在同一缩进级别,则文件中可能存在标记不匹配
“expand_javascript”:false,//(在构造中)在标记内部扩展javascript(也纯粹是巧合地影响CSS)
“expand_tags”:false,//将标记属性展开到新行上
“minimum_attribute_count”:2,//将标记属性扩展到新行之前所需的最小属性数
“第一行上的第一个属性”:false,//将所有属性放在标记的单独行上(仅使用1个缩进单位,而不是将所有属性与第一行对齐)
“preserve_newlines”:true,//是否应保留现有换行符,
“max_preserve_newlines”:2,//一个块中要保留的最大换行数
“reduce\u empty\u tags”:false,//如果结束标记和开始标记之间没有内容,则将它们放在同一行上
“reduce_thigh_word_tags”:false,//如果在结束标记和开始标记之间有完整的单词,则将它们放在同一行上
“custom_singleton”:“”//HTML5规范之外的各种模板语言的自定义singleton标记
},

使用
减少整个单词标签
选项:

"reduce_whole_word_tags": false, // Put closing tags on same line as opening tag if there is whole word between them
您将其设置为
false
。将其设置为
true