我正在寻找一个具有自动格式化ejs文件功能的软件包。我已经安装了HTMLPrettify。是否可以将ejs添加为html格式,以便将其格式化为html代码?这对我来说已足够了。
答案 0 :(得分:6)
将.jsbeautifyrc文件添加到allowed_file_extensions“ejs”:
{
"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "ejs"],
"brace_style": "collapse", // "expand", "end-expand", "expand-strict"
"indent_char": " ",
"indent_handlebars": false, // e.g. {{#foo}}, {{/foo}}
"indent_inner_html": false,
"indent_scripts": "keep", // "separate", "normal"
"indent_size": 4,
"max_preserve_newlines": 10,
"preserve_newlines": true,
"unformatted": ["a", "sub", "sup", "b", "i", "u", "pre"],
"wrap_line_length": 0
}, ...