Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/staging/main' into staging/main
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Action committed Feb 16, 2024
2 parents 115c317 + f53ce3a commit 9e479db
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Cached node_modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package*.json') }}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.15.1
* Turn new angular templating off by default in html ([#2247](https://github.com/beautifier/js-beautify/pull/2247))
* Perf regression in latest release (1.15.0) ([#2246](https://github.com/beautifier/js-beautify/issues/2246))

## v1.15.0
* Fixed #2219 - formatting of new Angular control flow syntax ([#2221](https://github.com/beautifier/js-beautify/pull/2221))

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ JS Beautifier is hosted on two CDN services: [cdnjs](https://cdnjs.com/libraries

To pull the latest version from one of these services include one set of the script tags below in your document:
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.0/beautify.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.0/beautify-css.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.0/beautify-html.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.1/beautify.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.1/beautify-css.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.1/beautify-html.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.0/beautify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.0/beautify-css.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.0/beautify-html.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.1/beautify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.1/beautify-css.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.1/beautify-html.min.js"></script>
```

Example usage of a JS tag in html:
Expand All @@ -76,7 +76,7 @@ Example usage of a JS tag in html:

. . .

<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.0/beautify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.1/beautify.min.js"></script>
<script src="script.js"></script>
</body>
</html>
Expand Down Expand Up @@ -434,4 +434,4 @@ Thanks also to Jason Diamond, Patrick Hof, Nochum Sossonko, Andreas Schneider, D
Vasilevsky, Vital Batmanov, Ron Baldwin, Gabriel Harrison, Chris J. Shull,
Mathias Bynens, Vittorio Gambaletta and others.
(README.md: [email protected].0)
(README.md: [email protected].1)
7 changes: 4 additions & 3 deletions js/src/cli.js
Original file line number Diff line number Diff line change
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
4 changes: 2 additions & 2 deletions js/src/core/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,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
2 changes: 1 addition & 1 deletion js/src/html/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var BaseOptions = require('../core/options').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
Loading

0 comments on commit 9e479db

Please sign in to comment.