diff --git a/CHANGELOG.md b/CHANGELOG.md index 820d64cb2..8f4c48c0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ + +# v0.33.2 (2018-09-12) +- (BREAKING CHANGE) Added `inline` and `content_unformatted` options from `js-beautify` html settings and cleared `unformatted`. Breaking change but generally improves the behavior to more accurately beautify html. ([#2210](https://github.com/Glavin001/atom-beautify/issues/2210), [#2215](https://github.com/Glavin001/atom-beautify/pull/2215), [js-beautify#1407](https://github.com/beautify-web/js-beautify/pull/1407)) + # v0.33.1 (2018-09-09) - Remove dependency marko-prettyprint in an effort to resolve installation and update issues diff --git a/docs/options.md b/docs/options.md index 99cb129a8..a3a7339aa 100644 --- a/docs/options.md +++ b/docs/options.md @@ -796,12 +796,14 @@ Indentation uses tabs, overrides `Indent Size` and `Indent Char` (Supported by b | `default_beautifier` | :white_check_mark: | | `beautify_on_save` | :white_check_mark: | | `brace_style` | :white_check_mark: | +| `content_unformatted` | :white_check_mark: | | `end_with_newline` | :white_check_mark: | | `extra_liners` | :white_check_mark: | | `indent_char` | :white_check_mark: | | `indent_inner_html` | :white_check_mark: | | `indent_scripts` | :white_check_mark: | | `indent_size` | :white_check_mark: | +| `inline` | :white_check_mark: | | `max_preserve_newlines` | :white_check_mark: | | `preserve_newlines` | :white_check_mark: | | `unformatted` | :white_check_mark: | @@ -896,6 +898,35 @@ Automatically beautify Blade files on save } ``` +##### [Content unformatted](#content-unformatted) + +**Namespace**: `html` + +**Key**: `content_unformatted` + +**Default**: `pre,textarea` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "content_unformatted": [ + "pre", + "textarea" + ] + } +} +``` + ##### [End with newline](#end-with-newline) **Namespace**: `html` @@ -1054,65 +1085,13 @@ Indentation size/length (Supported by JS Beautify) } ``` -##### [Max preserve newlines](#max-preserve-newlines) - -**Namespace**: `html` - -**Key**: `max_preserve_newlines` - -**Default**: `10` - -**Type**: `integer` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "max_preserve_newlines": 10 - } -} -``` - -##### [Preserve newlines](#preserve-newlines) - -**Namespace**: `html` - -**Key**: `preserve_newlines` - -**Default**: `true` - -**Type**: `boolean` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -Preserve line-breaks (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "preserve_newlines": true - } -} -``` - -##### [Unformatted](#unformatted) +##### [Inline](#inline) **Namespace**: `html` -**Key**: `unformatted` +**Key**: `inline` -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,strike,tt` **Type**: `array` @@ -1120,14 +1099,14 @@ Preserve line-breaks (Supported by JS Beautify) **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify) +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ + "inline": [ "a", "abbr", "area", @@ -1186,21 +1165,89 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J "big", "dt", "ins", - "small", "strike", - "tt", - "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" + "tt" ] } } ``` +##### [Max preserve newlines](#max-preserve-newlines) + +**Namespace**: `html` + +**Key**: `max_preserve_newlines` + +**Default**: `10` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "max_preserve_newlines": 10 + } +} +``` + +##### [Preserve newlines](#preserve-newlines) + +**Namespace**: `html` + +**Key**: `preserve_newlines` + +**Default**: `true` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Preserve line-breaks (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "preserve_newlines": true + } +} +``` + +##### [Unformatted](#unformatted) + +**Namespace**: `html` + +**Key**: `unformatted` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "unformatted": [] + } +} +``` + ##### [Wrap attributes](#wrap-attributes) **Namespace**: `html` @@ -1211,13 +1258,13 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** @@ -2635,6 +2682,7 @@ Path to uncrustify config file. i.e. uncrustify.cfg (Supported by Uncrustify) | `beautify_on_save` | :white_check_mark: | :white_check_mark: | | `brace_style` | :white_check_mark: | :x: | | `break_chained_methods` | :white_check_mark: | :white_check_mark: | +| `content_unformatted` | :white_check_mark: | :x: | | `end_of_line` | :white_check_mark: | :x: | | `end_with_comma` | :white_check_mark: | :white_check_mark: | | `end_with_newline` | :white_check_mark: | :x: | @@ -2646,6 +2694,7 @@ Path to uncrustify config file. i.e. uncrustify.cfg (Supported by Uncrustify) | `indent_scripts` | :white_check_mark: | :x: | | `indent_size` | :white_check_mark: | :white_check_mark: | | `indent_with_tabs` | :white_check_mark: | :white_check_mark: | +| `inline` | :white_check_mark: | :x: | | `jslint_happy` | :white_check_mark: | :x: | | `keep_array_indentation` | :white_check_mark: | :x: | | `keep_function_indentation` | :white_check_mark: | :x: | @@ -2772,6 +2821,35 @@ Break chained method calls across subsequent lines (Supported by JS Beautify, Pr } ``` +##### [Content unformatted](#content-unformatted) + +**Namespace**: `html` + +**Key**: `content_unformatted` + +**Default**: `pre,textarea` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "content_unformatted": [ + "pre", + "textarea" + ] + } +} +``` + ##### [End of line](#end-of-line) **Namespace**: `js` @@ -3054,35 +3132,98 @@ Indentation uses tabs, overrides `Indent Size` and `Indent Char` (Supported by J } ``` -##### [Jslint happy](#jslint-happy) +##### [Inline](#inline) -**Namespace**: `js` +**Namespace**: `html` -**Key**: `jslint_happy` +**Key**: `inline` -**Type**: `boolean` +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,strike,tt` + +**Type**: `array` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Enable jslint-stricter mode (Supported by JS Beautify) +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { - "js": { - "jslint_happy": false + "html": { + "inline": [ + "a", + "abbr", + "area", + "audio", + "b", + "bdi", + "bdo", + "br", + "button", + "canvas", + "cite", + "code", + "data", + "datalist", + "del", + "dfn", + "em", + "embed", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "keygen", + "label", + "map", + "mark", + "math", + "meter", + "noscript", + "object", + "output", + "progress", + "q", + "ruby", + "s", + "samp", + "select", + "small", + "span", + "strong", + "sub", + "sup", + "svg", + "template", + "textarea", + "time", + "u", + "var", + "video", + "wbr", + "text", + "acronym", + "address", + "big", + "dt", + "ins", + "strike", + "tt" + ] } } ``` -##### [Keep array indentation](#keep-array-indentation) +##### [Jslint happy](#jslint-happy) **Namespace**: `js` -**Key**: `keep_array_indentation` +**Key**: `jslint_happy` **Type**: `boolean` @@ -3090,19 +3231,43 @@ Enable jslint-stricter mode (Supported by JS Beautify) **Description**: -Preserve array indentation (Supported by JS Beautify) +Enable jslint-stricter mode (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "js": { - "keep_array_indentation": false + "jslint_happy": false } } ``` -##### [Keep function indentation](#keep-function-indentation) +##### [Keep array indentation](#keep-array-indentation) + +**Namespace**: `js` + +**Key**: `keep_array_indentation` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Preserve array indentation (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "js": { + "keep_array_indentation": false + } +} +``` + +##### [Keep function indentation](#keep-function-indentation) **Namespace**: `js` @@ -3306,91 +3471,20 @@ Decode printable characters encoded in xNN notation (Supported by JS Beautify) **Key**: `unformatted` -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` - **Type**: `array` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify) +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ - "a", - "abbr", - "area", - "audio", - "b", - "bdi", - "bdo", - "br", - "button", - "canvas", - "cite", - "code", - "data", - "datalist", - "del", - "dfn", - "em", - "embed", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "map", - "mark", - "math", - "meter", - "noscript", - "object", - "output", - "progress", - "q", - "ruby", - "s", - "samp", - "select", - "small", - "span", - "strong", - "sub", - "sup", - "svg", - "template", - "textarea", - "time", - "u", - "var", - "video", - "wbr", - "text", - "acronym", - "address", - "big", - "dt", - "ins", - "small", - "strike", - "tt", - "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" - ] + "unformatted": [] } } ``` @@ -3405,13 +3499,13 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** @@ -4451,12 +4545,14 @@ Maximum characters per line (0 disables) (Supported by Pretty Diff) | `default_beautifier` | :white_check_mark: | :white_check_mark: | | `beautify_on_save` | :white_check_mark: | :white_check_mark: | | `brace_style` | :white_check_mark: | :x: | +| `content_unformatted` | :white_check_mark: | :x: | | `end_with_newline` | :white_check_mark: | :x: | | `extra_liners` | :white_check_mark: | :x: | | `indent_char` | :white_check_mark: | :white_check_mark: | | `indent_inner_html` | :white_check_mark: | :x: | | `indent_scripts` | :white_check_mark: | :x: | | `indent_size` | :white_check_mark: | :white_check_mark: | +| `inline` | :white_check_mark: | :x: | | `max_preserve_newlines` | :white_check_mark: | :x: | | `preserve_newlines` | :white_check_mark: | :white_check_mark: | | `unformatted` | :white_check_mark: | :x: | @@ -4551,6 +4647,35 @@ Automatically beautify Handlebars files on save } ``` +##### [Content unformatted](#content-unformatted) + +**Namespace**: `html` + +**Key**: `content_unformatted` + +**Default**: `pre,textarea` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "content_unformatted": [ + "pre", + "textarea" + ] + } +} +``` + ##### [End with newline](#end-with-newline) **Namespace**: `html` @@ -4709,65 +4834,13 @@ Indentation size/length (Supported by JS Beautify, Pretty Diff) } ``` -##### [Max preserve newlines](#max-preserve-newlines) - -**Namespace**: `html` - -**Key**: `max_preserve_newlines` - -**Default**: `10` - -**Type**: `integer` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "max_preserve_newlines": 10 - } -} -``` - -##### [Preserve newlines](#preserve-newlines) - -**Namespace**: `html` - -**Key**: `preserve_newlines` - -**Default**: `true` - -**Type**: `boolean` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) - -**Description**: - -Preserve line-breaks (Supported by JS Beautify, Pretty Diff) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "preserve_newlines": true - } -} -``` - -##### [Unformatted](#unformatted) +##### [Inline](#inline) **Namespace**: `html` -**Key**: `unformatted` +**Key**: `inline` -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,strike,tt` **Type**: `array` @@ -4775,14 +4848,14 @@ Preserve line-breaks (Supported by JS Beautify, Pretty Diff) **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify) +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ + "inline": [ "a", "abbr", "area", @@ -4841,21 +4914,89 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J "big", "dt", "ins", - "small", "strike", - "tt", - "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" + "tt" ] } } ``` +##### [Max preserve newlines](#max-preserve-newlines) + +**Namespace**: `html` + +**Key**: `max_preserve_newlines` + +**Default**: `10` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "max_preserve_newlines": 10 + } +} +``` + +##### [Preserve newlines](#preserve-newlines) + +**Namespace**: `html` + +**Key**: `preserve_newlines` + +**Default**: `true` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) + +**Description**: + +Preserve line-breaks (Supported by JS Beautify, Pretty Diff) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "preserve_newlines": true + } +} +``` + +##### [Unformatted](#unformatted) + +**Namespace**: `html` + +**Key**: `unformatted` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "unformatted": [] + } +} +``` + ##### [Wrap attributes](#wrap-attributes) **Namespace**: `html` @@ -4866,13 +5007,13 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** @@ -5015,12 +5156,14 @@ Automatically beautify Haskell files on save | `default_beautifier` | :white_check_mark: | :white_check_mark: | | `beautify_on_save` | :white_check_mark: | :white_check_mark: | | `brace_style` | :white_check_mark: | :x: | +| `content_unformatted` | :white_check_mark: | :x: | | `end_with_newline` | :white_check_mark: | :x: | | `extra_liners` | :white_check_mark: | :x: | | `indent_char` | :white_check_mark: | :white_check_mark: | | `indent_inner_html` | :white_check_mark: | :x: | | `indent_scripts` | :white_check_mark: | :x: | | `indent_size` | :white_check_mark: | :white_check_mark: | +| `inline` | :white_check_mark: | :x: | | `max_preserve_newlines` | :white_check_mark: | :x: | | `preserve_newlines` | :white_check_mark: | :white_check_mark: | | `unformatted` | :white_check_mark: | :x: | @@ -5115,37 +5258,66 @@ Automatically beautify HTML files on save } ``` -##### [End with newline](#end-with-newline) +##### [Content unformatted](#content-unformatted) **Namespace**: `html` -**Key**: `end_with_newline` +**Key**: `content_unformatted` -**Type**: `boolean` +**Default**: `pre,textarea` + +**Type**: `array` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -End output with newline (Supported by JS Beautify) +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "end_with_newline": false + "content_unformatted": [ + "pre", + "textarea" + ] } } ``` -##### [Extra liners](#extra-liners) +##### [End with newline](#end-with-newline) **Namespace**: `html` -**Key**: `extra_liners` +**Key**: `end_with_newline` -**Default**: `head,body,/html` +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +End output with newline (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "end_with_newline": false + } +} +``` + +##### [Extra liners](#extra-liners) + +**Namespace**: `html` + +**Key**: `extra_liners` + +**Default**: `head,body,/html` **Type**: `array` @@ -5273,65 +5445,13 @@ Indentation size/length (Supported by JS Beautify, Pretty Diff) } ``` -##### [Max preserve newlines](#max-preserve-newlines) +##### [Inline](#inline) **Namespace**: `html` -**Key**: `max_preserve_newlines` +**Key**: `inline` -**Default**: `10` - -**Type**: `integer` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "max_preserve_newlines": 10 - } -} -``` - -##### [Preserve newlines](#preserve-newlines) - -**Namespace**: `html` - -**Key**: `preserve_newlines` - -**Default**: `true` - -**Type**: `boolean` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) - -**Description**: - -Preserve line-breaks (Supported by JS Beautify, Pretty Diff) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "preserve_newlines": true - } -} -``` - -##### [Unformatted](#unformatted) - -**Namespace**: `html` - -**Key**: `unformatted` - -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,strike,tt` **Type**: `array` @@ -5339,14 +5459,14 @@ Preserve line-breaks (Supported by JS Beautify, Pretty Diff) **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify) +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ + "inline": [ "a", "abbr", "area", @@ -5405,21 +5525,89 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J "big", "dt", "ins", - "small", "strike", - "tt", - "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" + "tt" ] } } ``` +##### [Max preserve newlines](#max-preserve-newlines) + +**Namespace**: `html` + +**Key**: `max_preserve_newlines` + +**Default**: `10` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "max_preserve_newlines": 10 + } +} +``` + +##### [Preserve newlines](#preserve-newlines) + +**Namespace**: `html` + +**Key**: `preserve_newlines` + +**Default**: `true` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) + +**Description**: + +Preserve line-breaks (Supported by JS Beautify, Pretty Diff) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "preserve_newlines": true + } +} +``` + +##### [Unformatted](#unformatted) + +**Namespace**: `html` + +**Key**: `unformatted` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "unformatted": [] + } +} +``` + ##### [Wrap attributes](#wrap-attributes) **Namespace**: `html` @@ -5430,13 +5618,13 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** @@ -8530,12 +8718,14 @@ Enables raw YAML front matter to be detected (thus ignoring markdown-like syntax | `default_beautifier` | :white_check_mark: | | `beautify_on_save` | :white_check_mark: | | `brace_style` | :white_check_mark: | +| `content_unformatted` | :white_check_mark: | | `end_with_newline` | :white_check_mark: | | `extra_liners` | :white_check_mark: | | `indent_char` | :white_check_mark: | | `indent_inner_html` | :white_check_mark: | | `indent_scripts` | :white_check_mark: | | `indent_size` | :white_check_mark: | +| `inline` | :white_check_mark: | | `max_preserve_newlines` | :white_check_mark: | | `preserve_newlines` | :white_check_mark: | | `syntax` | :white_check_mark: | @@ -8631,6 +8821,35 @@ Automatically beautify Marko files on save } ``` +##### [Content unformatted](#content-unformatted) + +**Namespace**: `html` + +**Key**: `content_unformatted` + +**Default**: `pre,textarea` + +**Type**: `array` + +**Supported Beautifiers**: [`Marko Beautifier`](#marko-beautifier) + +**Description**: + +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by Marko Beautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "content_unformatted": [ + "pre", + "textarea" + ] + } +} +``` + ##### [End with newline](#end-with-newline) **Namespace**: `html` @@ -8789,6 +9008,93 @@ Indentation size/length (Supported by Marko Beautifier) } ``` +##### [Inline](#inline) + +**Namespace**: `html` + +**Key**: `inline` + +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,strike,tt` + +**Type**: `array` + +**Supported Beautifiers**: [`Marko Beautifier`](#marko-beautifier) + +**Description**: + +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by Marko Beautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "inline": [ + "a", + "abbr", + "area", + "audio", + "b", + "bdi", + "bdo", + "br", + "button", + "canvas", + "cite", + "code", + "data", + "datalist", + "del", + "dfn", + "em", + "embed", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "keygen", + "label", + "map", + "mark", + "math", + "meter", + "noscript", + "object", + "output", + "progress", + "q", + "ruby", + "s", + "samp", + "select", + "small", + "span", + "strong", + "sub", + "sup", + "svg", + "template", + "textarea", + "time", + "u", + "var", + "video", + "wbr", + "text", + "acronym", + "address", + "big", + "dt", + "ins", + "strike", + "tt" + ] + } +} +``` + ##### [Max preserve newlines](#max-preserve-newlines) **Namespace**: `html` @@ -8875,91 +9181,20 @@ Preserve line-breaks (Supported by Marko Beautifier) **Key**: `unformatted` -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` - **Type**: `array` **Supported Beautifiers**: [`Marko Beautifier`](#marko-beautifier) **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by Marko Beautifier) +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by Marko Beautifier) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ - "a", - "abbr", - "area", - "audio", - "b", - "bdi", - "bdo", - "br", - "button", - "canvas", - "cite", - "code", - "data", - "datalist", - "del", - "dfn", - "em", - "embed", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "map", - "mark", - "math", - "meter", - "noscript", - "object", - "output", - "progress", - "q", - "ruby", - "s", - "samp", - "select", - "small", - "span", - "strong", - "sub", - "sup", - "svg", - "template", - "textarea", - "time", - "u", - "var", - "video", - "wbr", - "text", - "acronym", - "address", - "big", - "dt", - "ins", - "small", - "strike", - "tt", - "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" - ] + "unformatted": [] } } ``` @@ -8974,13 +9209,13 @@ List of tags (defaults to inline) that should not be reformatted (Supported by M **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`Marko Beautifier`](#marko-beautifier) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by Marko Beautifier) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by Marko Beautifier) **Example `.jsbeautifyrc` Configuration** @@ -9054,12 +9289,14 @@ Maximum characters per line (0 disables) (Supported by Marko Beautifier) | `default_beautifier` | :white_check_mark: | :white_check_mark: | | `beautify_on_save` | :white_check_mark: | :white_check_mark: | | `brace_style` | :white_check_mark: | :x: | +| `content_unformatted` | :white_check_mark: | :x: | | `end_with_newline` | :white_check_mark: | :x: | | `extra_liners` | :white_check_mark: | :x: | | `indent_char` | :white_check_mark: | :white_check_mark: | | `indent_inner_html` | :white_check_mark: | :x: | | `indent_scripts` | :white_check_mark: | :x: | | `indent_size` | :white_check_mark: | :white_check_mark: | +| `inline` | :white_check_mark: | :x: | | `max_preserve_newlines` | :white_check_mark: | :x: | | `preserve_newlines` | :white_check_mark: | :white_check_mark: | | `unformatted` | :white_check_mark: | :x: | @@ -9154,6 +9391,35 @@ Automatically beautify Mustache files on save } ``` +##### [Content unformatted](#content-unformatted) + +**Namespace**: `html` + +**Key**: `content_unformatted` + +**Default**: `pre,textarea` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "content_unformatted": [ + "pre", + "textarea" + ] + } +} +``` + ##### [End with newline](#end-with-newline) **Namespace**: `html` @@ -9312,65 +9578,13 @@ Indentation size/length (Supported by JS Beautify, Pretty Diff) } ``` -##### [Max preserve newlines](#max-preserve-newlines) +##### [Inline](#inline) **Namespace**: `html` -**Key**: `max_preserve_newlines` +**Key**: `inline` -**Default**: `10` - -**Type**: `integer` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "max_preserve_newlines": 10 - } -} -``` - -##### [Preserve newlines](#preserve-newlines) - -**Namespace**: `html` - -**Key**: `preserve_newlines` - -**Default**: `true` - -**Type**: `boolean` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) - -**Description**: - -Preserve line-breaks (Supported by JS Beautify, Pretty Diff) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "preserve_newlines": true - } -} -``` - -##### [Unformatted](#unformatted) - -**Namespace**: `html` - -**Key**: `unformatted` - -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,strike,tt,pre,h1,h2,h3,h4,h5,h6` +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,strike,tt` **Type**: `array` @@ -9378,14 +9592,14 @@ Preserve line-breaks (Supported by JS Beautify, Pretty Diff) **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify) +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ + "inline": [ "a", "abbr", "area", @@ -9444,19 +9658,88 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J "big", "dt", "strike", - "tt", - "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" + "tt" ] } } ``` +##### [Max preserve newlines](#max-preserve-newlines) + +**Namespace**: `html` + +**Key**: `max_preserve_newlines` + +**Default**: `10` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "max_preserve_newlines": 10 + } +} +``` + +##### [Preserve newlines](#preserve-newlines) + +**Namespace**: `html` + +**Key**: `preserve_newlines` + +**Default**: `true` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) + +**Description**: + +Preserve line-breaks (Supported by JS Beautify, Pretty Diff) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "preserve_newlines": true + } +} +``` + +##### [Unformatted](#unformatted) + +**Namespace**: `html` + +**Key**: `unformatted` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "unformatted": [] + } +} +``` + ##### [Wrap attributes](#wrap-attributes) **Namespace**: `html` @@ -9467,13 +9750,13 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** @@ -14178,6 +14461,7 @@ Maximum characters per line (0 disables) (Supported by Pretty Diff) | `beautify_on_save` | :white_check_mark: | :white_check_mark: | :white_check_mark: | | `brace_style` | :x: | :x: | :white_check_mark: | | `break_chained_methods` | :x: | :x: | :white_check_mark: | +| `content_unformatted` | :x: | :x: | :white_check_mark: | | `end_of_line` | :x: | :x: | :white_check_mark: | | `end_with_comma` | :x: | :x: | :white_check_mark: | | `end_with_newline` | :x: | :x: | :white_check_mark: | @@ -14189,6 +14473,7 @@ Maximum characters per line (0 disables) (Supported by Pretty Diff) | `indent_scripts` | :x: | :x: | :white_check_mark: | | `indent_size` | :x: | :x: | :white_check_mark: | | `indent_with_tabs` | :x: | :x: | :white_check_mark: | +| `inline` | :x: | :x: | :white_check_mark: | | `jslint_happy` | :x: | :x: | :white_check_mark: | | `keep_array_indentation` | :x: | :x: | :white_check_mark: | | `keep_function_indentation` | :x: | :x: | :white_check_mark: | @@ -14315,6 +14600,35 @@ Break chained method calls across subsequent lines (Supported by Vue Beautifier) } ``` +##### [Content unformatted](#content-unformatted) + +**Namespace**: `html` + +**Key**: `content_unformatted` + +**Default**: `pre,textarea` + +**Type**: `array` + +**Supported Beautifiers**: [`Vue Beautifier`](#vue-beautifier) + +**Description**: + +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by Vue Beautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "content_unformatted": [ + "pre", + "textarea" + ] + } +} +``` + ##### [End of line](#end-of-line) **Namespace**: `js` @@ -14597,6 +14911,93 @@ Indentation uses tabs, overrides `Indent Size` and `Indent Char` (Supported by V } ``` +##### [Inline](#inline) + +**Namespace**: `html` + +**Key**: `inline` + +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,strike,tt` + +**Type**: `array` + +**Supported Beautifiers**: [`Vue Beautifier`](#vue-beautifier) + +**Description**: + +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by Vue Beautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "inline": [ + "a", + "abbr", + "area", + "audio", + "b", + "bdi", + "bdo", + "br", + "button", + "canvas", + "cite", + "code", + "data", + "datalist", + "del", + "dfn", + "em", + "embed", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "keygen", + "label", + "map", + "mark", + "math", + "meter", + "noscript", + "object", + "output", + "progress", + "q", + "ruby", + "s", + "samp", + "select", + "small", + "span", + "strong", + "sub", + "sup", + "svg", + "template", + "textarea", + "time", + "u", + "var", + "video", + "wbr", + "text", + "acronym", + "address", + "big", + "dt", + "ins", + "strike", + "tt" + ] + } +} +``` + ##### [Jslint happy](#jslint-happy) **Namespace**: `js` @@ -14849,91 +15250,20 @@ Decode printable characters encoded in xNN notation (Supported by Vue Beautifier **Key**: `unformatted` -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` - **Type**: `array` **Supported Beautifiers**: [`Vue Beautifier`](#vue-beautifier) **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by Vue Beautifier) +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by Vue Beautifier) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ - "a", - "abbr", - "area", - "audio", - "b", - "bdi", - "bdo", - "br", - "button", - "canvas", - "cite", - "code", - "data", - "datalist", - "del", - "dfn", - "em", - "embed", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "map", - "mark", - "math", - "meter", - "noscript", - "object", - "output", - "progress", - "q", - "ruby", - "s", - "samp", - "select", - "small", - "span", - "strong", - "sub", - "sup", - "svg", - "template", - "textarea", - "time", - "u", - "var", - "video", - "wbr", - "text", - "acronym", - "address", - "big", - "dt", - "ins", - "small", - "strike", - "tt", - "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" - ] + "unformatted": [] } } ``` @@ -14948,13 +15278,13 @@ List of tags (defaults to inline) that should not be reformatted (Supported by V **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`Vue Beautifier`](#vue-beautifier) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by Vue Beautifier) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by Vue Beautifier) **Example `.jsbeautifyrc` Configuration** @@ -15028,12 +15358,14 @@ Maximum characters per line (0 disables) (Supported by Vue Beautifier) | `default_beautifier` | :white_check_mark: | :white_check_mark: | | `beautify_on_save` | :white_check_mark: | :white_check_mark: | | `brace_style` | :white_check_mark: | :x: | +| `content_unformatted` | :white_check_mark: | :x: | | `end_with_newline` | :white_check_mark: | :x: | | `extra_liners` | :white_check_mark: | :x: | | `indent_char` | :white_check_mark: | :white_check_mark: | | `indent_inner_html` | :white_check_mark: | :x: | | `indent_scripts` | :white_check_mark: | :x: | | `indent_size` | :white_check_mark: | :white_check_mark: | +| `inline` | :white_check_mark: | :x: | | `max_preserve_newlines` | :white_check_mark: | :x: | | `preserve_newlines` | :white_check_mark: | :white_check_mark: | | `unformatted` | :white_check_mark: | :x: | @@ -15128,37 +15460,13 @@ Automatically beautify XML files on save } ``` -##### [End with newline](#end-with-newline) - -**Namespace**: `html` - -**Key**: `end_with_newline` - -**Type**: `boolean` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -End output with newline (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "end_with_newline": false - } -} -``` - -##### [Extra liners](#extra-liners) +##### [Content unformatted](#content-unformatted) **Namespace**: `html` -**Key**: `extra_liners` +**Key**: `content_unformatted` -**Default**: `head,body,/html` +**Default**: `pre,textarea` **Type**: `array` @@ -15166,185 +15474,186 @@ End output with newline (Supported by JS Beautify) **Description**: -List of tags (defaults to [head,body,/html] that should have an extra newline before them. (Supported by JS Beautify) +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "extra_liners": [ - "head", - "body", - "/html" + "content_unformatted": [ + "pre", + "textarea" ] } } ``` -##### [Indent char](#indent-char) +##### [End with newline](#end-with-newline) **Namespace**: `html` -**Key**: `indent_char` - -**Default**: ` ` +**Key**: `end_with_newline` -**Type**: `string` +**Type**: `boolean` -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Indentation character (Supported by JS Beautify, Pretty Diff) +End output with newline (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "indent_char": " " + "end_with_newline": false } } ``` -##### [Indent inner html](#indent-inner-html) +##### [Extra liners](#extra-liners) **Namespace**: `html` -**Key**: `indent_inner_html` +**Key**: `extra_liners` -**Type**: `boolean` +**Default**: `head,body,/html` + +**Type**: `array` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Indent
and sections. (Supported by JS Beautify) +List of tags (defaults to [head,body,/html] that should have an extra newline before them. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "indent_inner_html": false + "extra_liners": [ + "head", + "body", + "/html" + ] } } ``` -##### [Indent scripts](#indent-scripts) +##### [Indent char](#indent-char) **Namespace**: `html` -**Key**: `indent_scripts` +**Key**: `indent_char` -**Default**: `normal` +**Default**: ` ` **Type**: `string` -**Enum**: `keep` `separate` `normal` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) **Description**: -[keep|separate|normal] (Supported by JS Beautify) +Indentation character (Supported by JS Beautify, Pretty Diff) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "indent_scripts": "normal" + "indent_char": " " } } ``` -##### [Indent size](#indent-size) +##### [Indent inner html](#indent-inner-html) **Namespace**: `html` -**Key**: `indent_size` - -**Default**: `4` +**Key**: `indent_inner_html` -**Type**: `integer` +**Type**: `boolean` -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Indentation size/length (Supported by JS Beautify, Pretty Diff) +Indent and sections. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "indent_size": 4 + "indent_inner_html": false } } ``` -##### [Max preserve newlines](#max-preserve-newlines) +##### [Indent scripts](#indent-scripts) **Namespace**: `html` -**Key**: `max_preserve_newlines` +**Key**: `indent_scripts` -**Default**: `10` +**Default**: `normal` -**Type**: `integer` +**Type**: `string` + +**Enum**: `keep` `separate` `normal` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) +[keep|separate|normal] (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "max_preserve_newlines": 10 + "indent_scripts": "normal" } } ``` -##### [Preserve newlines](#preserve-newlines) +##### [Indent size](#indent-size) **Namespace**: `html` -**Key**: `preserve_newlines` +**Key**: `indent_size` -**Default**: `true` +**Default**: `4` -**Type**: `boolean` +**Type**: `integer` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) **Description**: -Preserve line-breaks (Supported by JS Beautify, Pretty Diff) +Indentation size/length (Supported by JS Beautify, Pretty Diff) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "preserve_newlines": true + "indent_size": 4 } } ``` -##### [Unformatted](#unformatted) +##### [Inline](#inline) **Namespace**: `html` -**Key**: `unformatted` +**Key**: `inline` -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,strike,tt` **Type**: `array` @@ -15352,14 +15661,14 @@ Preserve line-breaks (Supported by JS Beautify, Pretty Diff) **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify) +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ + "inline": [ "a", "abbr", "area", @@ -15418,21 +15727,89 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J "big", "dt", "ins", - "small", "strike", - "tt", - "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" + "tt" ] } } ``` +##### [Max preserve newlines](#max-preserve-newlines) + +**Namespace**: `html` + +**Key**: `max_preserve_newlines` + +**Default**: `10` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "max_preserve_newlines": 10 + } +} +``` + +##### [Preserve newlines](#preserve-newlines) + +**Namespace**: `html` + +**Key**: `preserve_newlines` + +**Default**: `true` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) + +**Description**: + +Preserve line-breaks (Supported by JS Beautify, Pretty Diff) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "preserve_newlines": true + } +} +``` + +##### [Unformatted](#unformatted) + +**Namespace**: `html` + +**Key**: `unformatted` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "unformatted": [] + } +} +``` + ##### [Wrap attributes](#wrap-attributes) **Namespace**: `html` @@ -15443,13 +15820,13 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** @@ -16178,13 +16555,13 @@ Maximum characters per line (0 disables) (Supported by JS Beautify, Pretty Diff) **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** @@ -16280,7 +16657,31 @@ Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) **Key**: `unformatted` -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "unformatted": [] + } +} +``` + +##### [Inline](#inline) + +**Namespace**: `html` + +**Key**: `inline` + +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,strike,tt` **Type**: `array` @@ -16288,14 +16689,14 @@ Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify) +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by JS Beautify) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ + "inline": [ "a", "abbr", "area", @@ -16354,16 +16755,37 @@ List of tags (defaults to inline) that should not be reformatted (Supported by J "big", "dt", "ins", - "small", "strike", - "tt", + "tt" + ] + } +} +``` + +##### [Content unformatted](#content-unformatted) + +**Namespace**: `html` + +**Key**: `content_unformatted` + +**Default**: `pre,textarea` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "content_unformatted": [ "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" + "textarea" ] } } @@ -17305,13 +17727,13 @@ Maximum characters per line (0 disables) (Supported by Marko Beautifier) **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`Marko Beautifier`](#marko-beautifier) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by Marko Beautifier) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by Marko Beautifier) **Example `.jsbeautifyrc` Configuration** @@ -17407,7 +17829,31 @@ Number of line-breaks to be preserved in one chunk (Supported by Marko Beautifie **Key**: `unformatted` -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` +**Type**: `array` + +**Supported Beautifiers**: [`Marko Beautifier`](#marko-beautifier) + +**Description**: + +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by Marko Beautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "unformatted": [] + } +} +``` + +##### [Inline](#inline) + +**Namespace**: `html` + +**Key**: `inline` + +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,strike,tt` **Type**: `array` @@ -17415,14 +17861,14 @@ Number of line-breaks to be preserved in one chunk (Supported by Marko Beautifie **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by Marko Beautifier) +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by Marko Beautifier) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ + "inline": [ "a", "abbr", "area", @@ -17481,16 +17927,37 @@ List of tags (defaults to inline) that should not be reformatted (Supported by M "big", "dt", "ins", - "small", "strike", - "tt", + "tt" + ] + } +} +``` + +##### [Content unformatted](#content-unformatted) + +**Namespace**: `html` + +**Key**: `content_unformatted` + +**Default**: `pre,textarea` + +**Type**: `array` + +**Supported Beautifiers**: [`Marko Beautifier`](#marko-beautifier) + +**Description**: + +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by Marko Beautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "content_unformatted": [ "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" + "textarea" ] } } @@ -19364,13 +19831,13 @@ Indent and sections. (Supported by Vue Beautifier) **Type**: `string` -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` +**Enum**: `auto` `aligned-multiple` `force` `force-aligned` `force-expand-multiline` **Supported Beautifiers**: [`Vue Beautifier`](#vue-beautifier) **Description**: -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by Vue Beautifier) +Wrap attributes to new lines [auto|aligned-multiple|force|force-aligned|force-expand-multiline] (Supported by Vue Beautifier) **Example `.jsbeautifyrc` Configuration** @@ -19414,7 +19881,31 @@ Indent wrapped attributes to after N characters (Supported by Vue Beautifier) **Key**: `unformatted` -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` +**Type**: `array` + +**Supported Beautifiers**: [`Vue Beautifier`](#vue-beautifier) + +**Description**: + +(Deprecated for most scenarios - consider inline or content_unformatted) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior. (Supported by Vue Beautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "unformatted": [] + } +} +``` + +##### [Inline](#inline) + +**Namespace**: `html` + +**Key**: `inline` + +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,strike,tt` **Type**: `array` @@ -19422,14 +19913,14 @@ Indent wrapped attributes to after N characters (Supported by Vue Beautifier) **Description**: -List of tags (defaults to inline) that should not be reformatted (Supported by Vue Beautifier) +List of inline tags. Behaves similar to text content, will not wrap without whitespace. (Supported by Vue Beautifier) **Example `.jsbeautifyrc` Configuration** ```json { "html": { - "unformatted": [ + "inline": [ "a", "abbr", "area", @@ -19488,16 +19979,37 @@ List of tags (defaults to inline) that should not be reformatted (Supported by V "big", "dt", "ins", - "small", "strike", - "tt", + "tt" + ] + } +} +``` + +##### [Content unformatted](#content-unformatted) + +**Namespace**: `html` + +**Key**: `content_unformatted` + +**Default**: `pre,textarea` + +**Type**: `array` + +**Supported Beautifiers**: [`Vue Beautifier`](#vue-beautifier) + +**Description**: + +List of tags whose contents should not be reformatted. Attributes will be reformatted, inner html will not. (Supported by Vue Beautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "content_unformatted": [ "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" + "textarea" ] } } diff --git a/examples/nested-jsbeautifyrc/twig/expected/test.twig b/examples/nested-jsbeautifyrc/twig/expected/test.twig index c6e64977a..39ca44b39 100644 --- a/examples/nested-jsbeautifyrc/twig/expected/test.twig +++ b/examples/nested-jsbeautifyrc/twig/expected/test.twig @@ -12,7 +12,8 @@ {% endfor %} -