js-beautify
Advanced tools
Comparing version 1.14.6 to 1.14.7
@@ -661,3 +661,3 @@ /*jshint node:true */ | ||
parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted); | ||
parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || parser_token.tag_start_char === '{'; | ||
parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || parser_token.tag_name.includes("-") || parser_token.tag_start_char === '{'; | ||
@@ -664,0 +664,0 @@ return parser_token; |
{ | ||
"name": "js-beautify", | ||
"version": "1.14.6", | ||
"version": "1.14.7", | ||
"description": "beautifier.io for node", | ||
@@ -5,0 +5,0 @@ "main": "js/index.js", |
@@ -61,11 +61,25 @@ <p align="center"><img src="https://raw.githubusercontent.com/beautify-web/js-beautify/7db71fc/web/wordmark-light.svg" height="200px" align="center" alt="JS Beautifier"/></p> | ||
```html | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify-css.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify-html.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.7/beautify.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.7/beautify-css.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.7/beautify-html.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify-css.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify-html.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.7/beautify.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.7/beautify-css.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.7/beautify-html.min.js"></script> | ||
``` | ||
Example usage of a JS tag in html: | ||
```html | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<body> | ||
. . . | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.7/beautify.min.js"></script> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> | ||
``` | ||
Older versions are available by changing the version number. | ||
@@ -95,4 +109,25 @@ | ||
## Web Library | ||
The script tags above expose three functions: `js_beautify`, `css_beautify`, and `html_beautify`. | ||
After you embed the `<script>` tags in your `html` file, they expose three functions: `js_beautify`, `css_beautify`, and `html_beautify` | ||
Example usage of beautifying a json string: | ||
```js | ||
const options = { indent_size: 2, space_in_empty_paren: true } | ||
const dataObj = {completed: false,id: 1,title: "delectus aut autem",userId: 1,} | ||
const dataJson = JSON.stringify(dataObj) | ||
js_beautify(dataJson, options) | ||
/* OUTPUT | ||
{ | ||
"completed": false, | ||
"id": 1, | ||
"title": "delectus aut autem", | ||
"userId": 1, | ||
} | ||
*/ | ||
``` | ||
## Node.js JavaScript | ||
@@ -402,2 +437,2 @@ | ||
(README.md: js-beautify@1.14.6) | ||
(README.md: js-beautify@1.14.7) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
963728
436