mirror of
https://github.com/beautifier/js-beautify.git
synced 2024-11-26 22:20:56 +00:00
Release: 1.15.1
This commit is contained in:
parent
f11af53db1
commit
8ebec7e81a
@ -2316,9 +2316,9 @@ function Options(options, merge_child_field) {
|
||||
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
|
||||
|
||||
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
|
||||
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
|
||||
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
|
||||
// other values ignored
|
||||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty', 'angular'], ['auto']);
|
||||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
|
||||
}
|
||||
|
||||
Options.prototype._get_array = function(name, default_value) {
|
||||
@ -5633,7 +5633,7 @@ var BaseOptions = (__webpack_require__(7).Options);
|
||||
function Options(options) {
|
||||
BaseOptions.call(this, options, 'html');
|
||||
if (this.templating.length === 1 && this.templating[0] === 'auto') {
|
||||
this.templating = ['django', 'erb', 'handlebars', 'php', 'angular'];
|
||||
this.templating = ['django', 'erb', 'handlebars', 'php'];
|
||||
}
|
||||
|
||||
this.indent_inner_html = this._get_boolean('indent_inner_html');
|
||||
|
File diff suppressed because one or more lines are too long
2
js/lib/beautifier.min.js
vendored
2
js/lib/beautifier.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -572,9 +572,9 @@ function Options(options, merge_child_field) {
|
||||
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
|
||||
|
||||
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
|
||||
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
|
||||
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
|
||||
// other values ignored
|
||||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty', 'angular'], ['auto']);
|
||||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
|
||||
}
|
||||
|
||||
Options.prototype._get_array = function(name, default_value) {
|
||||
|
@ -641,9 +641,9 @@ function Options(options, merge_child_field) {
|
||||
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
|
||||
|
||||
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
|
||||
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
|
||||
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
|
||||
// other values ignored
|
||||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty', 'angular'], ['auto']);
|
||||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
|
||||
}
|
||||
|
||||
Options.prototype._get_array = function(name, default_value) {
|
||||
@ -2707,7 +2707,7 @@ var BaseOptions = (__webpack_require__(6).Options);
|
||||
function Options(options) {
|
||||
BaseOptions.call(this, options, 'html');
|
||||
if (this.templating.length === 1 && this.templating[0] === 'auto') {
|
||||
this.templating = ['django', 'erb', 'handlebars', 'php', 'angular'];
|
||||
this.templating = ['django', 'erb', 'handlebars', 'php'];
|
||||
}
|
||||
|
||||
this.indent_inner_html = this._get_boolean('indent_inner_html');
|
||||
|
@ -2347,9 +2347,9 @@ function Options(options, merge_child_field) {
|
||||
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
|
||||
|
||||
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
|
||||
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
|
||||
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
|
||||
// other values ignored
|
||||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty', 'angular'], ['auto']);
|
||||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
|
||||
}
|
||||
|
||||
Options.prototype._get_array = function(name, default_value) {
|
||||
|
@ -199,7 +199,7 @@ var path = require('path'),
|
||||
// no shorthand for "config"
|
||||
// no shorthand for "editorconfig"
|
||||
// no shorthand for "indent_empty_lines"
|
||||
// not shorthad for "templating"
|
||||
// no shorthad for "templating"
|
||||
});
|
||||
|
||||
function verifyExists(fullPath) {
|
||||
@ -370,7 +370,8 @@ function usage(err) {
|
||||
' [first newline in file, otherwise "\\n]',
|
||||
' -n, --end-with-newline End output with newline',
|
||||
' --indent-empty-lines Keep indentation on empty lines',
|
||||
' --templating List of templating languages (auto,none,django,erb,handlebars,php,smarty,angular) ["auto"] auto = none in JavaScript, all in html',
|
||||
' --templating List of templating languages (auto,none,angular,django,erb,handlebars,php,smarty)',
|
||||
' ["auto", auto = none in JavaScript, auto = all except angular in html (and inline javascript/css)]',
|
||||
' --editorconfig Use EditorConfig to set up the options'
|
||||
];
|
||||
|
||||
@ -409,7 +410,7 @@ function usage(err) {
|
||||
msg.push(' -U, --unformatted List of tags (defaults to inline) that should not be reformatted');
|
||||
msg.push(' -T, --content_unformatted List of tags (defaults to pre) whose content should not be reformatted');
|
||||
msg.push(' -E, --extra_liners List of tags (defaults to [head,body,/html] that should have an extra newline');
|
||||
msg.push(' --unformatted_content_delimiter Keep text content together between this string [""]');
|
||||
msg.push(' --unformatted_content_delimiter Keep text content together between this string [""]');
|
||||
break;
|
||||
case "css":
|
||||
msg.push(' -b, --brace-style [collapse|expand] ["collapse"]');
|
||||
|
@ -9654,6 +9654,30 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be
|
||||
' Text\n' +
|
||||
' </div>\n' +
|
||||
'}');
|
||||
|
||||
// CSS @media should remain unchanged
|
||||
bth(
|
||||
'<style type="text/css">\n' +
|
||||
' @media only screen and (min-width:480px) {\n' +
|
||||
' .mj-column-per-100 {\n' +
|
||||
' width: 100% !important;\n' +
|
||||
' max-width: 100%;\n' +
|
||||
' }\n' +
|
||||
' }\n' +
|
||||
'</style>',
|
||||
// -- output --
|
||||
'<style type="text/css">\n' +
|
||||
'@media only screen and (min-width:480px) {\n' +
|
||||
' .mj-column-per-100\n' +
|
||||
' {\n' +
|
||||
' width:\n' +
|
||||
' 100%\n' +
|
||||
' !important;\n' +
|
||||
' max-width:\n' +
|
||||
' 100%;\n' +
|
||||
'}\n' +
|
||||
' }\n' +
|
||||
'</style>');
|
||||
|
||||
|
||||
//============================================================
|
||||
@ -9731,6 +9755,17 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be
|
||||
' </p>\n' +
|
||||
' }\n' +
|
||||
'</div>');
|
||||
|
||||
// CSS @media should remain unchanged
|
||||
bth(
|
||||
'<style type="text/css">\n' +
|
||||
' @media only screen and (min-width:480px) {\n' +
|
||||
' .mj-column-per-100 {\n' +
|
||||
' width: 100% !important;\n' +
|
||||
' max-width: 100%;\n' +
|
||||
' }\n' +
|
||||
' }\n' +
|
||||
'</style>');
|
||||
|
||||
|
||||
//============================================================
|
||||
|
Loading…
Reference in New Issue
Block a user