Skip to content

Commit

Permalink
Release: 1.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Action committed Feb 16, 2024
1 parent f11af53 commit 8ebec7e
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 16 deletions.
6 changes: 3 additions & 3 deletions js/lib/beautifier.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/lib/beautifier.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/lib/beautifier.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/lib/beautifier.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/lib/beautify-css.js
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions js/lib/beautify-html.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions js/lib/beautify.js
Expand Up @@ -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) {
Expand Down
7 changes: 4 additions & 3 deletions js/lib/cli.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -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'
];

Expand Down Expand Up @@ -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"]');
Expand Down
35 changes: 35 additions & 0 deletions js/test/generated/beautify-html-tests.js
Expand Up @@ -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>');


//============================================================
Expand Down Expand Up @@ -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>');


//============================================================
Expand Down

0 comments on commit 8ebec7e

Please sign in to comment.