Skip to content

Commit 2eb37aa

Browse files
authored
Merge pull request #2066 from beautify-web/staging/release
Pulling staging/release into release
2 parents ab9d7c3 + 2689316 commit 2eb37aa

34 files changed

+2442
-379
lines changed

.DS_Store

8 KB
Binary file not shown.

CHANGELOG.md

Lines changed: 474 additions & 0 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ $(BUILD_DIR)/virtualenv: | $(BUILD_DIR)
144144
virtualenv --version || pip install virtualenv
145145
virtualenv build/python-dev
146146
virtualenv build/python-rel
147-
$(SCRIPT_DIR)/python-dev pip install pip --upgrade
148-
$(SCRIPT_DIR)/python-rel pip install pip --upgrade
147+
$(SCRIPT_DIR)/python-dev python -m pip install --upgrade pip || exit 0
148+
$(SCRIPT_DIR)/python-rel python -m pip install --upgrade pip || exit 0
149149
$(SCRIPT_DIR)/python-dev3 pip install black
150150
@touch $(BUILD_DIR)/virtualenv
151151

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,13 @@ JS Beautifier is hosted on two CDN services: [cdnjs](https://cdnjs.com/libraries
5858

5959
To pull the latest version from one of these services include one set of the script tags below in your document:
6060
```html
61-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.3/beautify.js"></script>
62-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.3/beautify-css.js"></script>
63-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.3/beautify-html.js"></script>
61+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify.js"></script>
62+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify-css.js"></script>
63+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify-html.js"></script>
6464

65-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.3/beautify.min.js"></script>
66-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.3/beautify-css.min.js"></script>
67-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.3/beautify-html.min.js"></script>
68-
69-
<script src="https://cdn.rawgit.com/beautify-web/js-beautify/v1.14.3/js/lib/beautify.js"></script>
70-
<script src="https://cdn.rawgit.com/beautify-web/js-beautify/v1.14.3/js/lib/beautify-css.js"></script>
71-
<script src="https://cdn.rawgit.com/beautify-web/js-beautify/v1.14.3/js/lib/beautify-html.js"></script>
65+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify.min.js"></script>
66+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify-css.min.js"></script>
67+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify-html.min.js"></script>
7268
```
7369

7470
Older versions are available by changing the version number.
@@ -401,4 +397,4 @@ Thanks also to Jason Diamond, Patrick Hof, Nochum Sossonko, Andreas Schneider, D
401397
Vasilevsky, Vital Batmanov, Ron Baldwin, Gabriel Harrison, Chris J. Shull,
402398
Mathias Bynens, Vittorio Gambaletta and others.
403399
404-
(README.md: js-beautify@1.14.3)
400+
(README.md: js-beautify@1.14.4)

index.html

Lines changed: 200 additions & 209 deletions
Large diffs are not rendered by default.

js/lib/beautifier.js

Lines changed: 49 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/lib/beautifier.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/lib/beautifier.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/lib/beautifier.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/lib/beautify-css.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ function Beautifier(source_text, options) {
10911091
"@document": true
10921092
};
10931093
this.NON_SEMICOLON_NEWLINE_PROPERTY = [
1094+
"grid-template-areas",
10941095
"grid-template"
10951096
];
10961097

@@ -1422,7 +1423,8 @@ Beautifier.prototype.beautify = function() {
14221423
}
14231424
}
14241425
} else if (this._ch === '"' || this._ch === '\'') {
1425-
this.preserveSingleSpace(isAfterSpace);
1426+
var preserveQuoteSpace = previous_ch === '"' || previous_ch === '\'';
1427+
this.preserveSingleSpace(preserveQuoteSpace || isAfterSpace);
14261428
this.print_string(this._ch + this.eatString(this._ch));
14271429
this.eatWhitespace(true);
14281430
} else if (this._ch === ';') {
@@ -1466,7 +1468,12 @@ Beautifier.prototype.beautify = function() {
14661468
}
14671469
}
14681470
} else {
1469-
this.preserveSingleSpace(isAfterSpace);
1471+
var space_needed = false;
1472+
if (this._input.lookBack("with")) {
1473+
// look back is not an accurate solution, we need tokens to confirm without whitespaces
1474+
space_needed = true;
1475+
}
1476+
this.preserveSingleSpace(isAfterSpace || space_needed);
14701477
this.print_string(this._ch);
14711478

14721479
// handle scss/sass map
@@ -1524,7 +1531,7 @@ Beautifier.prototype.beautify = function() {
15241531
this._ch = '';
15251532
}
15261533
} else if (this._ch === '!' && !this._input.lookBack("\\")) { // !important
1527-
this.print_string(' ');
1534+
this._output.space_before_token = true;
15281535
this.print_string(this._ch);
15291536
} else {
15301537
var preserveAfterSpace = previous_ch === '"' || previous_ch === '\'';

0 commit comments

Comments
 (0)