Skip to content

Commit 8ebec7e

Browse files
author
GitHub Action
committed
Release: 1.15.1
1 parent f11af53 commit 8ebec7e

9 files changed

+52
-16
lines changed

js/lib/beautifier.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/lib/beautifier.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/lib/beautifier.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/lib/beautifier.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/lib/beautify-css.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,9 @@ function Options(options, merge_child_field) {
572572
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
573573

574574
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
575-
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
575+
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
576576
// other values ignored
577-
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty', 'angular'], ['auto']);
577+
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
578578
}
579579

580580
Options.prototype._get_array = function(name, default_value) {

js/lib/beautify-html.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,9 @@ function Options(options, merge_child_field) {
641641
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
642642

643643
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
644-
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
644+
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
645645
// other values ignored
646-
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty', 'angular'], ['auto']);
646+
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
647647
}
648648

649649
Options.prototype._get_array = function(name, default_value) {
@@ -2707,7 +2707,7 @@ var BaseOptions = (__webpack_require__(6).Options);
27072707
function Options(options) {
27082708
BaseOptions.call(this, options, 'html');
27092709
if (this.templating.length === 1 && this.templating[0] === 'auto') {
2710-
this.templating = ['django', 'erb', 'handlebars', 'php', 'angular'];
2710+
this.templating = ['django', 'erb', 'handlebars', 'php'];
27112711
}
27122712

27132713
this.indent_inner_html = this._get_boolean('indent_inner_html');

js/lib/beautify.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2347,9 +2347,9 @@ function Options(options, merge_child_field) {
23472347
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
23482348

23492349
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
2350-
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
2350+
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
23512351
// other values ignored
2352-
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty', 'angular'], ['auto']);
2352+
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
23532353
}
23542354

23552355
Options.prototype._get_array = function(name, default_value) {

js/lib/cli.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ var path = require('path'),
199199
// no shorthand for "config"
200200
// no shorthand for "editorconfig"
201201
// no shorthand for "indent_empty_lines"
202-
// not shorthad for "templating"
202+
// no shorthad for "templating"
203203
});
204204

205205
function verifyExists(fullPath) {
@@ -370,7 +370,8 @@ function usage(err) {
370370
' [first newline in file, otherwise "\\n]',
371371
' -n, --end-with-newline End output with newline',
372372
' --indent-empty-lines Keep indentation on empty lines',
373-
' --templating List of templating languages (auto,none,django,erb,handlebars,php,smarty,angular) ["auto"] auto = none in JavaScript, all in html',
373+
' --templating List of templating languages (auto,none,angular,django,erb,handlebars,php,smarty)',
374+
' ["auto", auto = none in JavaScript, auto = all except angular in html (and inline javascript/css)]',
374375
' --editorconfig Use EditorConfig to set up the options'
375376
];
376377

@@ -409,7 +410,7 @@ function usage(err) {
409410
msg.push(' -U, --unformatted List of tags (defaults to inline) that should not be reformatted');
410411
msg.push(' -T, --content_unformatted List of tags (defaults to pre) whose content should not be reformatted');
411412
msg.push(' -E, --extra_liners List of tags (defaults to [head,body,/html] that should have an extra newline');
412-
msg.push(' --unformatted_content_delimiter Keep text content together between this string [""]');
413+
msg.push(' --unformatted_content_delimiter Keep text content together between this string [""]');
413414
break;
414415
case "css":
415416
msg.push(' -b, --brace-style [collapse|expand] ["collapse"]');

js/test/generated/beautify-html-tests.js

+35
Original file line numberDiff line numberDiff line change
@@ -9654,6 +9654,30 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be
96549654
' Text\n' +
96559655
' </div>\n' +
96569656
'}');
9657+
9658+
// CSS @media should remain unchanged
9659+
bth(
9660+
'<style type="text/css">\n' +
9661+
' @media only screen and (min-width:480px) {\n' +
9662+
' .mj-column-per-100 {\n' +
9663+
' width: 100% !important;\n' +
9664+
' max-width: 100%;\n' +
9665+
' }\n' +
9666+
' }\n' +
9667+
'</style>',
9668+
// -- output --
9669+
'<style type="text/css">\n' +
9670+
'@media only screen and (min-width:480px) {\n' +
9671+
' .mj-column-per-100\n' +
9672+
' {\n' +
9673+
' width:\n' +
9674+
' 100%\n' +
9675+
' !important;\n' +
9676+
' max-width:\n' +
9677+
' 100%;\n' +
9678+
'}\n' +
9679+
' }\n' +
9680+
'</style>');
96579681

96589682

96599683
//============================================================
@@ -9731,6 +9755,17 @@ function run_html_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_be
97319755
' </p>\n' +
97329756
' }\n' +
97339757
'</div>');
9758+
9759+
// CSS @media should remain unchanged
9760+
bth(
9761+
'<style type="text/css">\n' +
9762+
' @media only screen and (min-width:480px) {\n' +
9763+
' .mj-column-per-100 {\n' +
9764+
' width: 100% !important;\n' +
9765+
' max-width: 100%;\n' +
9766+
' }\n' +
9767+
' }\n' +
9768+
'</style>');
97349769

97359770

97369771
//============================================================

0 commit comments

Comments
 (0)