Unibeautify
  • Install
  • Docs
  • Assistant
  • Playground
  • GitHub

›M

A

  • Align Assignments
  • Arrow Parens

B

  • Brace Style
  • Break Chained Methods

C

  • Comma First

E

  • End With Comma
  • End With Newline
  • End With Semicolon

F

  • Force Indentation

I

  • Identifier Case
  • Indent Chained Methods
  • Indent Comments
  • Indent Inner Html
  • Indent Scripts
  • Indent Size
  • Indent Style

J

  • JSLint Happy
  • JSX Brackets

K

  • Keep Array Indentation
  • Keyword Case

M

  • Max Preserve Newlines
  • Multiline Ternary

N

  • Newline Before Tags
  • Newline Between Rules
  • No Leading Zero

O

  • Object Curly Spacing

P

  • Pragma Insert
  • Pragma Require
  • Preserve Newlines

Q

  • Quotes

R

  • Remove Trailing Whitespace

S

  • Selector Separator Newline
  • Space After Anon Function
  • Space Before Conditional
  • Space In Empty Paren
  • Space In Paren

U

  • Unescape Strings
  • Unformatted

W

  • Wrap Attributes
  • Wrap Attributes Indent Size
  • Wrap Line Length
  • Wrap Prose
Edit

Max Preserve Newlines

Config Key: max_preserve_newlines

Description: Number of line-breaks to be preserved in one chunk

Available since version: 0.7.0 (Current: npm)

Type: integer

Default: 10

Support

Edit Beautifiers

Languages: C#, CSS, ColdFusion, EJS, HTML, HTML+ERB, Handlebars, JSON, JSON5, JSX, Java, JavaScript, Less, Liquid, Mustache, Riot, SCSS, SVG, Spacebars, Swig, Titanium Style Sheets, Twig, TypeScript, Visualforce, XML, XTemplate

Beautifiers: JS-Beautify, Pretty Diff

Comparison Table

LanguageJS-BeautifyPretty Diff
C#❌✅
CSS❌✅
ColdFusion❌✅
EJS✅✅
HTML✅✅
HTML+ERB❌✅
Handlebars✅✅
JSON❌✅
JSON5❌✅
JSX✅✅
Java❌✅
JavaScript✅✅
Less❌✅
Liquid✅❌
Mustache✅❌
Riot❌✅
SCSS❌✅
SVG❌✅
Spacebars❌✅
Swig❌✅
Titanium Style Sheets❌✅
Twig❌✅
TypeScript❌✅
Visualforce❌✅
XML✅✅
XTemplate❌✅

Examples

Invisible characters are shown with the following symbols:

Carriage Return = ␍; Line Feed = ␊; Tab = ⇥; Whitespace = ·.

Edit C# Example

🚧 Original Code

using·System;␊
␊
class·Program␊
{␊
␊
␊
␊
␊
␊
␊
␊
static·void·Main()␊
{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
Console.WriteLine("Hello,·world!");␊
␊
}␊
}␊

🔧 0

Using Pretty Diff beautifier:

using·System;␊
class·Program·{␊
··static·void·Main()·{␊
····Console.WriteLine("Hello,·world!");␊
··}␊
}

How to configure A .unibeautify.json file would look like the following:

{
  "C#": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,34 +1,6 @@
 using·System;␊
-␊
-class·Program␊
-{␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-static·void·Main()␊
-{␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-Console.WriteLine("Hello,·world!");␊
-␊
-}␊
-}␊
+class·Program·{␊
+··static·void·Main()·{␊
+····Console.WriteLine("Hello,·world!");␊
+··}␊
+}
\ No newline at end of file

🔧 5

Using Pretty Diff beautifier:

using·System;␊
␊
class·Program·{␊
␊
␊
␊
␊
␊
··static·void·Main()·{␊
␊
␊
␊
␊
␊
····Console.WriteLine("Hello,·world!");␊
␊
··}␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "C#": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -1,34 +1,18 @@
 using·System;␊
 ␊
-class·Program␊
-{␊
+class·Program·{␊
 ␊
 ␊
 ␊
 ␊
 ␊
+··static·void·Main()·{␊
 ␊
 ␊
-static·void·Main()␊
-{␊
 ␊
 ␊
 ␊
+····Console.WriteLine("Hello,·world!");␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-Console.WriteLine("Hello,·world!");␊
-␊
+··}␊
 }␊
-}␊

🔧 10

Using Pretty Diff beautifier:

using·System;␊
␊
class·Program·{␊
␊
␊
␊
␊
␊
␊
␊
··static·void·Main()·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
····Console.WriteLine("Hello,·world!");␊
␊
··}␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "C#": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -1,17 +1,15 @@
 using·System;␊
 ␊
-class·Program␊
-{␊
+class·Program·{␊
 ␊
 ␊
 ␊
 ␊
 ␊
 ␊
 ␊
-static·void·Main()␊
-{␊
+··static·void·Main()·{␊
 ␊
 ␊
 ␊
 ␊
@@ -20,15 +18,8 @@
 ␊
 ␊
 ␊
 ␊
+····Console.WriteLine("Hello,·world!");␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-Console.WriteLine("Hello,·world!");␊
-␊
+··}␊
 }␊
-}␊

🔧 15

Using Pretty Diff beautifier:

using·System;␊
␊
class·Program·{␊
␊
␊
␊
␊
␊
␊
␊
··static·void·Main()·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
····Console.WriteLine("Hello,·world!");␊
␊
··}␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "C#": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -1,17 +1,15 @@
 using·System;␊
 ␊
-class·Program␊
-{␊
+class·Program·{␊
 ␊
 ␊
 ␊
 ␊
 ␊
 ␊
 ␊
-static·void·Main()␊
-{␊
+··static·void·Main()·{␊
 ␊
 ␊
 ␊
 ␊
@@ -25,10 +23,8 @@
 ␊
 ␊
 ␊
 ␊
+····Console.WriteLine("Hello,·world!");␊
 ␊
-␊
-Console.WriteLine("Hello,·world!");␊
-␊
+··}␊
 }␊
-}␊

🔧 20

Using Pretty Diff beautifier:

using·System;␊
␊
class·Program·{␊
␊
␊
␊
␊
␊
␊
␊
··static·void·Main()·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
····Console.WriteLine("Hello,·world!");␊
␊
··}␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "C#": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -1,17 +1,15 @@
 using·System;␊
 ␊
-class·Program␊
-{␊
+class·Program·{␊
 ␊
 ␊
 ␊
 ␊
 ␊
 ␊
 ␊
-static·void·Main()␊
-{␊
+··static·void·Main()·{␊
 ␊
 ␊
 ␊
 ␊
@@ -27,8 +25,8 @@
 ␊
 ␊
 ␊
 ␊
-Console.WriteLine("Hello,·world!");␊
+····Console.WriteLine("Hello,·world!");␊
 ␊
+··}␊
 }␊
-}␊

Edit CSS Example

🚧 Original Code

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

🔧 0

Using Pretty Diff beautifier:

.class1·{␊
··background-color:·red;␊
}

How to configure A .unibeautify.json file would look like the following:

{
  "CSS": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,22 +1,3 @@
-␊
 .class1·{␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 ··background-color:·red;␊
-␊
-␊
-␊
-}␊
+}
\ No newline at end of file

🔧 5

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "CSS": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -4,18 +4,8 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 ··background-color:·red;␊
 ␊
 ␊
 ␊

🔧 10

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "CSS": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -9,13 +9,8 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
 ··background-color:·red;␊
 ␊
 ␊
 ␊

🔧 15

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "CSS": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified

🔧 20

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "CSS": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified

Edit ColdFusion Example

🚧 Original Code

//·Any·variable·set·here·can·be·used·by·all·pages␊
//·Start·session·management.·Used·to·track·session·variables␊
␊
␊
␊
␊
␊
␊
␊
<cfset·this.sessionManagement·=·true>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
//·Start·client·management.·Used·to·track·client·variables␊
␊
␊
␊
<cfset·this.clientmanagement·=·true>␊
<cfset·this.name·=·"Name·of·your·application">␊

🔧 0

Using Pretty Diff beautifier:

//·Any·variable·set·here·can·be·used·by·all·pages␊
//·Start·session·management.·Used·to·track·session·variables␊
<·cfset·this.sessionManagement·=·true·>␊
//·Start·client·management.·Used·to·track·client·variables␊
<cfset·this.clientmanagement=true>␊
<cfset·this.name="Name·of·your·application">

How to configure A .unibeautify.json file would look like the following:

{
  "ColdFusion": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,32 +1,6 @@
 //·Any·variable·set·here·can·be·used·by·all·pages␊
 //·Start·session·management.·Used·to·track·session·variables␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-<cfset·this.sessionManagement·=·true>␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
+<·cfset·this.sessionManagement·=·true·>␊
 //·Start·client·management.·Used·to·track·client·variables␊
-␊
-␊
-␊
-<cfset·this.clientmanagement·=·true>␊
-<cfset·this.name·=·"Name·of·your·application">␊
+<cfset·this.clientmanagement=true>␊
+<cfset·this.name="Name·of·your·application">
\ No newline at end of file

🔧 5

Using Pretty Diff beautifier:

//·Any·variable·set·here·can·be·used·by·all·pages␊
//·Start·session·management.·Used·to·track·session·variables␊
␊
␊
␊
␊
␊
<·cfset·this.sessionManagement·=·true·>␊
␊
␊
␊
␊
␊
//·Start·client·management.·Used·to·track·client·variables␊
␊
␊
␊
<cfset·this.clientmanagement=true>␊
<cfset·this.name="Name·of·your·application">

How to configure A .unibeautify.json file would look like the following:

{
  "ColdFusion": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -4,29 +4,16 @@
 ␊
 ␊
 ␊
 ␊
+<·cfset·this.sessionManagement·=·true·>␊
 ␊
 ␊
-<cfset·this.sessionManagement·=·true>␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 //·Start·client·management.·Used·to·track·client·variables␊
 ␊
 ␊
 ␊
-<cfset·this.clientmanagement·=·true>␊
-<cfset·this.name·=·"Name·of·your·application">␊
+<cfset·this.clientmanagement=true>␊
+<cfset·this.name="Name·of·your·application">
\ No newline at end of file

🔧 10

Using Pretty Diff beautifier:

//·Any·variable·set·here·can·be·used·by·all·pages␊
//·Start·session·management.·Used·to·track·session·variables␊
␊
␊
␊
␊
␊
␊
␊
<·cfset·this.sessionManagement·=·true·>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
//·Start·client·management.·Used·to·track·client·variables␊
␊
␊
␊
<cfset·this.clientmanagement=true>␊
<cfset·this.name="Name·of·your·application">

How to configure A .unibeautify.json file would look like the following:

{
  "ColdFusion": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -6,9 +6,9 @@
 ␊
 ␊
 ␊
 ␊
-<cfset·this.sessionManagement·=·true>␊
+<·cfset·this.sessionManagement·=·true·>␊
 ␊
 ␊
 ␊
 ␊
@@ -17,16 +17,10 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
 //·Start·client·management.·Used·to·track·client·variables␊
 ␊
 ␊
 ␊
-<cfset·this.clientmanagement·=·true>␊
-<cfset·this.name·=·"Name·of·your·application">␊
+<cfset·this.clientmanagement=true>␊
+<cfset·this.name="Name·of·your·application">
\ No newline at end of file

🔧 15

Using Pretty Diff beautifier:

//·Any·variable·set·here·can·be·used·by·all·pages␊
//·Start·session·management.·Used·to·track·session·variables␊
␊
␊
␊
␊
␊
␊
␊
<·cfset·this.sessionManagement·=·true·>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
//·Start·client·management.·Used·to·track·client·variables␊
␊
␊
␊
<cfset·this.clientmanagement=true>␊
<cfset·this.name="Name·of·your·application">

How to configure A .unibeautify.json file would look like the following:

{
  "ColdFusion": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -6,9 +6,9 @@
 ␊
 ␊
 ␊
 ␊
-<cfset·this.sessionManagement·=·true>␊
+<·cfset·this.sessionManagement·=·true·>␊
 ␊
 ␊
 ␊
 ␊
@@ -22,11 +22,10 @@
 ␊
 ␊
 ␊
 ␊
-␊
 //·Start·client·management.·Used·to·track·client·variables␊
 ␊
 ␊
 ␊
-<cfset·this.clientmanagement·=·true>␊
-<cfset·this.name·=·"Name·of·your·application">␊
+<cfset·this.clientmanagement=true>␊
+<cfset·this.name="Name·of·your·application">
\ No newline at end of file

🔧 20

Using Pretty Diff beautifier:

//·Any·variable·set·here·can·be·used·by·all·pages␊
//·Start·session·management.·Used·to·track·session·variables␊
␊
␊
␊
␊
␊
␊
␊
<·cfset·this.sessionManagement·=·true·>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
//·Start·client·management.·Used·to·track·client·variables␊
␊
␊
␊
<cfset·this.clientmanagement=true>␊
<cfset·this.name="Name·of·your·application">

How to configure A .unibeautify.json file would look like the following:

{
  "ColdFusion": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -6,9 +6,9 @@
 ␊
 ␊
 ␊
 ␊
-<cfset·this.sessionManagement·=·true>␊
+<·cfset·this.sessionManagement·=·true·>␊
 ␊
 ␊
 ␊
 ␊
@@ -27,6 +27,6 @@
 //·Start·client·management.·Used·to·track·client·variables␊
 ␊
 ␊
 ␊
-<cfset·this.clientmanagement·=·true>␊
-<cfset·this.name·=·"Name·of·your·application">␊
+<cfset·this.clientmanagement=true>␊
+<cfset·this.name="Name·of·your·application">
\ No newline at end of file

Add EJS Example

No example found. Please submit a Pull Request!

Edit HTML Example

🚧 Original Code

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
<script>␊
␊
␊
console.log("hello·world");␊
␊
␊
</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

🔧 0

Using JS-Beautify beautifier:

<html>␊
␊
<body>␊
··<script>␊
····console.log("hello·world");␊
··</script>␊
</body>␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "HTML": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,42 +1,9 @@
 <html>␊
 ␊
-␊
-␊
 <body>␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
+··<script>␊
+····console.log("hello·world");␊
+··</script>␊
 </body>␊
 ␊
-␊
-␊
 </html>
\ No newline at end of file

🔧 5

Using JS-Beautify beautifier:

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
··<script>␊
····console.log("hello·world");␊
··</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "HTML": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -7,35 +7,13 @@
 ␊
 ␊
 ␊
 ␊
+··<script>␊
+····console.log("hello·world");␊
+··</script>␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
 </body>␊
 ␊
 ␊
 ␊

🔧 10

Using JS-Beautify beautifier:

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··<script>␊
····console.log("hello·world");␊
··</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "HTML": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -12,30 +12,13 @@
 ␊
 ␊
 ␊
 ␊
+··<script>␊
+····console.log("hello·world");␊
+··</script>␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
 </body>␊
 ␊
 ␊
 ␊

🔧 15

Using JS-Beautify beautifier:

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··<script>␊
····console.log("hello·world");␊
··</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "HTML": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -17,25 +17,13 @@
 ␊
 ␊
 ␊
 ␊
+··<script>␊
+····console.log("hello·world");␊
+··</script>␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
 </body>␊
 ␊
 ␊
 ␊

🔧 20

Using JS-Beautify beautifier:

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··<script>␊
····console.log("hello·world");␊
··</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "HTML": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -22,20 +22,13 @@
 ␊
 ␊
 ␊
 ␊
+··<script>␊
+····console.log("hello·world");␊
+··</script>␊
 ␊
 ␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
 </body>␊
 ␊
 ␊
 ␊

Edit HTML+ERB Example

🚧 Original Code

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
<script>␊
␊
␊
console.log("hello·world");␊
␊
␊
</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

🔧 0

Using Pretty Diff beautifier:

<html>␊
··<body>␊
····<script>␊
······console.log("hello·world");␊
····</script>␊
··</body>␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "HTML+ERB": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,42 +1,7 @@
 <html>␊
-␊
-␊
-␊
-<body>␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
-</body>␊
-␊
-␊
-␊
+··<body>␊
+····<script>␊
+······console.log("hello·world");␊
+····</script>␊
+··</body>␊
 </html>
\ No newline at end of file

🔧 5

Using Pretty Diff beautifier:

<html>␊
␊
␊
␊
··<body>␊
␊
␊
␊
␊
␊
····<script>␊
␊
␊
······console.log("hello·world");␊
····</script>␊
␊
␊
··</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "HTML+ERB": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -1,42 +1,22 @@
 <html>␊
 ␊
 ␊
 ␊
-<body>␊
+··<body>␊
 ␊
 ␊
 ␊
 ␊
 ␊
+····<script>␊
 ␊
 ␊
+······console.log("hello·world");␊
+····</script>␊
 ␊
 ␊
+··</body>␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
-</body>␊
-␊
-␊
-␊
 </html>
\ No newline at end of file

🔧 10

Using Pretty Diff beautifier:

<html>␊
␊
␊
␊
··<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
····<script>␊
␊
␊
······console.log("hello·world");␊
····</script>␊
␊
␊
··</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "HTML+ERB": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -1,9 +1,9 @@
 <html>␊
 ␊
 ␊
 ␊
-<body>␊
+··<body>␊
 ␊
 ␊
 ␊
 ␊
@@ -12,31 +12,16 @@
 ␊
 ␊
 ␊
 ␊
+····<script>␊
 ␊
 ␊
+······console.log("hello·world");␊
+····</script>␊
 ␊
 ␊
+··</body>␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
-</body>␊
-␊
-␊
-␊
 </html>
\ No newline at end of file

🔧 15

Using Pretty Diff beautifier:

<html>␊
␊
␊
␊
··<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
····<script>␊
␊
␊
······console.log("hello·world");␊
····</script>␊
␊
␊
··</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "HTML+ERB": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -1,9 +1,9 @@
 <html>␊
 ␊
 ␊
 ␊
-<body>␊
+··<body>␊
 ␊
 ␊
 ␊
 ␊
@@ -17,26 +17,16 @@
 ␊
 ␊
 ␊
 ␊
+····<script>␊
 ␊
 ␊
+······console.log("hello·world");␊
+····</script>␊
 ␊
 ␊
+··</body>␊
 ␊
 ␊
 ␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
-</body>␊
-␊
-␊
-␊
 </html>
\ No newline at end of file

🔧 20

Using Pretty Diff beautifier:

<html>␊
␊
␊
␊
··<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
····<script>␊
␊
␊
······console.log("hello·world");␊
····</script>␊
␊
␊
··</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "HTML+ERB": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -1,9 +1,9 @@
 <html>␊
 ␊
 ␊
 ␊
-<body>␊
+··<body>␊
 ␊
 ␊
 ␊
 ␊
@@ -22,21 +22,16 @@
 ␊
 ␊
 ␊
 ␊
+····<script>␊
 ␊
 ␊
+······console.log("hello·world");␊
+····</script>␊
 ␊
-<script>␊
 ␊
+··</body>␊
 ␊
-console.log("hello·world");␊
 ␊
 ␊
-</script>␊
-␊
-␊
-</body>␊
-␊
-␊
-␊
 </html>
\ No newline at end of file

Add Handlebars Example

No example found. Please submit a Pull Request!

Edit JSON Example

🚧 Original Code

{␊
␊
␊
····"key":·"value"␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
}␊

🔧 0

Using Pretty Diff beautifier:

{␊
··"key":·"value"␊
}

How to configure A .unibeautify.json file would look like the following:

{
  "JSON": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,21 +1,3 @@
 {␊
-␊
-␊
-····"key":·"value"␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-}␊
+··"key":·"value"␊
+}
\ No newline at end of file

🔧 5

Using Pretty Diff beautifier:

{␊
␊
␊
··"key":·"value"␊
␊
␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "JSON": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -1,21 +1,10 @@
 {␊
 ␊
 ␊
-····"key":·"value"␊
+··"key":·"value"␊
 ␊
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 }␊

🔧 10

Using Pretty Diff beautifier:

{␊
␊
␊
··"key":·"value"␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "JSON": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -1,8 +1,8 @@
 {␊
 ␊
 ␊
-····"key":·"value"␊
+··"key":·"value"␊
 ␊
 ␊
 ␊
 ␊
@@ -11,11 +11,5 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
 }␊

🔧 15

Using Pretty Diff beautifier:

{␊
␊
␊
··"key":·"value"␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "JSON": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -1,8 +1,8 @@
 {␊
 ␊
 ␊
-····"key":·"value"␊
+··"key":·"value"␊
 ␊
 ␊
 ␊
 ␊
@@ -16,6 +16,5 @@
 ␊
 ␊
 ␊
 ␊
-␊
 }␊

🔧 20

Using Pretty Diff beautifier:

{␊
␊
␊
··"key":·"value"␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "JSON": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -1,8 +1,8 @@
 {␊
 ␊
 ␊
-····"key":·"value"␊
+··"key":·"value"␊
 ␊
 ␊
 ␊
 ␊

Edit JSON5 Example

🚧 Original Code

{␊
␊
␊
····"key":·"value"␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
}␊

🔧 0

Using Pretty Diff beautifier:

{␊
··"key":·"value"␊
}

How to configure A .unibeautify.json file would look like the following:

{
  "JSON5": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,21 +1,3 @@
 {␊
-␊
-␊
-····"key":·"value"␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-}␊
+··"key":·"value"␊
+}
\ No newline at end of file

🔧 5

Using Pretty Diff beautifier:

{␊
␊
␊
··"key":·"value"␊
␊
␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "JSON5": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -1,21 +1,10 @@
 {␊
 ␊
 ␊
-····"key":·"value"␊
+··"key":·"value"␊
 ␊
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 }␊

🔧 10

Using Pretty Diff beautifier:

{␊
␊
␊
··"key":·"value"␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "JSON5": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -1,8 +1,8 @@
 {␊
 ␊
 ␊
-····"key":·"value"␊
+··"key":·"value"␊
 ␊
 ␊
 ␊
 ␊
@@ -11,11 +11,5 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
 }␊

🔧 15

Using Pretty Diff beautifier:

{␊
␊
␊
··"key":·"value"␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "JSON5": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -1,8 +1,8 @@
 {␊
 ␊
 ␊
-····"key":·"value"␊
+··"key":·"value"␊
 ␊
 ␊
 ␊
 ␊
@@ -16,6 +16,5 @@
 ␊
 ␊
 ␊
 ␊
-␊
 }␊

🔧 20

Using Pretty Diff beautifier:

{␊
␊
␊
··"key":·"value"␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "JSON5": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -1,8 +1,8 @@
 {␊
 ␊
 ␊
-····"key":·"value"␊
+··"key":·"value"␊
 ␊
 ␊
 ␊
 ␊

Edit JSX Example

🚧 Original Code

␊
console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");␊
␊

🔧 0

Using JS-Beautify beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "JSX": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -14,6 +13,5 @@
 ␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

🔧 5

Using JS-Beautify beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "JSX": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -1,19 +1,9 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

🔧 10

Using JS-Beautify beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "JSX": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -8,12 +7,8 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

🔧 15

Using JS-Beautify beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "JSX": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -14,6 +13,5 @@
 ␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

🔧 20

Using JS-Beautify beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "JSX": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -14,6 +13,5 @@
 ␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

Edit Java Example

🚧 Original Code

public·class·HelloWorld·{␊
␊
␊
····public·static·void·main(String[]·args)·{␊
␊
␊
␊
········//·Prints·"Hello,·World"·to·the·terminal·window.␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
········System.out.println("Hello,·World");␊
␊
␊
␊
␊
␊
····}␊
␊
}␊

🔧 0

Using Pretty Diff beautifier:

public·class·HelloWorld·{␊
··public·static·void·main(String[]·args)·{␊
····//·Prints·"Hello,·World"·to·the·terminal·window.␊
····System.out.println("Hello,·World");␊
··}␊
}

How to configure A .unibeautify.json file would look like the following:

{
  "Java": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,39 +1,6 @@
 public·class·HelloWorld·{␊
-␊
-␊
-····public·static·void·main(String[]·args)·{␊
-␊
-␊
-␊
-········//·Prints·"Hello,·World"·to·the·terminal·window.␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-········System.out.println("Hello,·World");␊
-␊
-␊
-␊
-␊
-␊
-····}␊
-␊
-}␊
+··public·static·void·main(String[]·args)·{␊
+····//·Prints·"Hello,·World"·to·the·terminal·window.␊
+····System.out.println("Hello,·World");␊
+··}␊
+}
\ No newline at end of file

🔧 5

Using Pretty Diff beautifier:

public·class·HelloWorld·{␊
␊
␊
··public·static·void·main(String[]·args)·{␊
␊
␊
␊
····//·Prints·"Hello,·World"·to·the·terminal·window.␊
␊
␊
␊
␊
␊
····System.out.println("Hello,·World");␊
␊
␊
␊
␊
␊
··}␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "Java": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -1,39 +1,22 @@
 public·class·HelloWorld·{␊
 ␊
 ␊
-····public·static·void·main(String[]·args)·{␊
+··public·static·void·main(String[]·args)·{␊
 ␊
 ␊
 ␊
-········//·Prints·"Hello,·World"·to·the·terminal·window.␊
+····//·Prints·"Hello,·World"·to·the·terminal·window.␊
 ␊
 ␊
 ␊
 ␊
 ␊
+····System.out.println("Hello,·World");␊
 ␊
 ␊
 ␊
 ␊
 ␊
+··}␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-········System.out.println("Hello,·World");␊
-␊
-␊
-␊
-␊
-␊
-····}␊
-␊
 }␊

🔧 10

Using Pretty Diff beautifier:

public·class·HelloWorld·{␊
␊
␊
··public·static·void·main(String[]·args)·{␊
␊
␊
␊
····//·Prints·"Hello,·World"·to·the·terminal·window.␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
····System.out.println("Hello,·World");␊
␊
␊
␊
␊
␊
··}␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "Java": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -1,12 +1,12 @@
 public·class·HelloWorld·{␊
 ␊
 ␊
-····public·static·void·main(String[]·args)·{␊
+··public·static·void·main(String[]·args)·{␊
 ␊
 ␊
 ␊
-········//·Prints·"Hello,·World"·to·the·terminal·window.␊
+····//·Prints·"Hello,·World"·to·the·terminal·window.␊
 ␊
 ␊
 ␊
 ␊
@@ -15,25 +15,13 @@
 ␊
 ␊
 ␊
 ␊
+····System.out.println("Hello,·World");␊
 ␊
 ␊
 ␊
 ␊
 ␊
+··}␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-········System.out.println("Hello,·World");␊
-␊
-␊
-␊
-␊
-␊
-····}␊
-␊
 }␊

🔧 15

Using Pretty Diff beautifier:

public·class·HelloWorld·{␊
␊
␊
··public·static·void·main(String[]·args)·{␊
␊
␊
␊
····//·Prints·"Hello,·World"·to·the·terminal·window.␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
····System.out.println("Hello,·World");␊
␊
␊
␊
␊
␊
··}␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "Java": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -1,12 +1,12 @@
 public·class·HelloWorld·{␊
 ␊
 ␊
-····public·static·void·main(String[]·args)·{␊
+··public·static·void·main(String[]·args)·{␊
 ␊
 ␊
 ␊
-········//·Prints·"Hello,·World"·to·the·terminal·window.␊
+····//·Prints·"Hello,·World"·to·the·terminal·window.␊
 ␊
 ␊
 ␊
 ␊
@@ -20,20 +20,13 @@
 ␊
 ␊
 ␊
 ␊
+····System.out.println("Hello,·World");␊
 ␊
 ␊
 ␊
 ␊
 ␊
+··}␊
 ␊
-␊
-········System.out.println("Hello,·World");␊
-␊
-␊
-␊
-␊
-␊
-····}␊
-␊
 }␊

🔧 20

Using Pretty Diff beautifier:

public·class·HelloWorld·{␊
␊
␊
··public·static·void·main(String[]·args)·{␊
␊
␊
␊
····//·Prints·"Hello,·World"·to·the·terminal·window.␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
····System.out.println("Hello,·World");␊
␊
␊
␊
␊
␊
··}␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "Java": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -1,12 +1,12 @@
 public·class·HelloWorld·{␊
 ␊
 ␊
-····public·static·void·main(String[]·args)·{␊
+··public·static·void·main(String[]·args)·{␊
 ␊
 ␊
 ␊
-········//·Prints·"Hello,·World"·to·the·terminal·window.␊
+····//·Prints·"Hello,·World"·to·the·terminal·window.␊
 ␊
 ␊
 ␊
 ␊
@@ -25,15 +25,13 @@
 ␊
 ␊
 ␊
 ␊
+····System.out.println("Hello,·World");␊
 ␊
 ␊
-········System.out.println("Hello,·World");␊
 ␊
 ␊
 ␊
+··}␊
 ␊
-␊
-····}␊
-␊
 }␊

Edit JavaScript Example

🚧 Original Code

␊
console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");␊
␊

🔧 0

Using JS-Beautify beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "JavaScript": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -14,6 +13,5 @@
 ␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

🔧 5

Using JS-Beautify beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "JavaScript": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -1,19 +1,9 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

🔧 10

Using JS-Beautify beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "JavaScript": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -8,12 +7,8 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

🔧 15

Using JS-Beautify beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "JavaScript": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -14,6 +13,5 @@
 ␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

🔧 20

Using JS-Beautify beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "JavaScript": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -14,6 +13,5 @@
 ␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

Edit Less Example

🚧 Original Code

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

🔧 0

Using Pretty Diff beautifier:

.class1·{␊
··background-color:·red;␊
}

How to configure A .unibeautify.json file would look like the following:

{
  "Less": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,22 +1,3 @@
-␊
 .class1·{␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 ··background-color:·red;␊
-␊
-␊
-␊
-}␊
+}
\ No newline at end of file

🔧 5

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "Less": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -4,18 +4,8 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 ··background-color:·red;␊
 ␊
 ␊
 ␊

🔧 10

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "Less": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -9,13 +9,8 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
 ··background-color:·red;␊
 ␊
 ␊
 ␊

🔧 15

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "Less": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified

🔧 20

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "Less": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified

Add Liquid Example

No example found. Please submit a Pull Request!

Add Mustache Example

No example found. Please submit a Pull Request!

Add Riot Example

No example found. Please submit a Pull Request!

Edit SCSS Example

🚧 Original Code

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

🔧 0

Using Pretty Diff beautifier:

.class1·{␊
··background-color:·red;␊
}

How to configure A .unibeautify.json file would look like the following:

{
  "SCSS": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,22 +1,3 @@
-␊
 .class1·{␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 ··background-color:·red;␊
-␊
-␊
-␊
-}␊
+}
\ No newline at end of file

🔧 5

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "SCSS": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -4,18 +4,8 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 ··background-color:·red;␊
 ␊
 ␊
 ␊

🔧 10

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "SCSS": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -9,13 +9,8 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
 ··background-color:·red;␊
 ␊
 ␊
 ␊

🔧 15

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "SCSS": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified

🔧 20

Using Pretty Diff beautifier:

␊
.class1·{␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··background-color:·red;␊
␊
␊
␊
}␊

How to configure A .unibeautify.json file would look like the following:

{
  "SCSS": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified

Add SVG Example

No example found. Please submit a Pull Request!

Add Spacebars Example

No example found. Please submit a Pull Request!

Add Swig Example

No example found. Please submit a Pull Request!

Add Titanium Style Sheets Example

No example found. Please submit a Pull Request!

Add Twig Example

No example found. Please submit a Pull Request!

Edit TypeScript Example

🚧 Original Code

␊
console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");␊
␊

🔧 0

Using Pretty Diff beautifier:

console.log("preserve_newlines1");␊
console.log("preserve_newlines2");␊
console.log("preserve_newlines3");

How to configure A .unibeautify.json file would look like the following:

{
  "TypeScript": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,19 +1,3 @@
-␊
 console.log("preserve_newlines1");␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 console.log("preserve_newlines2");␊
-␊
-␊
-console.log("preserve_newlines3");␊
-␊
+console.log("preserve_newlines3");
\ No newline at end of file

🔧 5

Using Pretty Diff beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");␊

How to configure A .unibeautify.json file would look like the following:

{
  "TypeScript": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -1,19 +1,10 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
 console.log("preserve_newlines3");␊
-␊

🔧 10

Using Pretty Diff beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");␊

How to configure A .unibeautify.json file would look like the following:

{
  "TypeScript": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -9,11 +8,8 @@
 ␊
 ␊
 ␊
 ␊
-␊
-␊
 console.log("preserve_newlines2");␊
 ␊
 ␊
 console.log("preserve_newlines3");␊
-␊

🔧 15

Using Pretty Diff beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");␊

How to configure A .unibeautify.json file would look like the following:

{
  "TypeScript": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -15,5 +14,4 @@
 console.log("preserve_newlines2");␊
 ␊
 ␊
 console.log("preserve_newlines3");␊
-␊

🔧 20

Using Pretty Diff beautifier:

console.log("preserve_newlines1");␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
console.log("preserve_newlines2");␊
␊
␊
console.log("preserve_newlines3");␊

How to configure A .unibeautify.json file would look like the following:

{
  "TypeScript": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "Pretty Diff"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -1,5 +1,4 @@
-␊
 console.log("preserve_newlines1");␊
 ␊
 ␊
 ␊
@@ -15,5 +14,4 @@
 console.log("preserve_newlines2");␊
 ␊
 ␊
 console.log("preserve_newlines3");␊
-␊

Add Visualforce Example

No example found. Please submit a Pull Request!

Edit XML Example

🚧 Original Code

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
<script>␊
␊
␊
console.log("hello·world");␊
␊
␊
</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

🔧 0

Using JS-Beautify beautifier:

<html>␊
␊
<body>␊
··<script>␊
····console.log("hello·world");␊
··</script>␊
</body>␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "XML": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 0,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 0
===================================================================
--- 0   Original
+++ 0   Beautified
@@ -1,42 +1,9 @@
 <html>␊
 ␊
-␊
-␊
 <body>␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
+··<script>␊
+····console.log("hello·world");␊
+··</script>␊
 </body>␊
 ␊
-␊
-␊
 </html>
\ No newline at end of file

🔧 5

Using JS-Beautify beautifier:

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
··<script>␊
····console.log("hello·world");␊
··</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "XML": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 5,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 5
===================================================================
--- 5   Original
+++ 5   Beautified
@@ -7,35 +7,13 @@
 ␊
 ␊
 ␊
 ␊
+··<script>␊
+····console.log("hello·world");␊
+··</script>␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
 </body>␊
 ␊
 ␊
 ␊

🔧 10

Using JS-Beautify beautifier:

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··<script>␊
····console.log("hello·world");␊
··</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "XML": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 10,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 10
===================================================================
--- 10  Original
+++ 10  Beautified
@@ -12,30 +12,13 @@
 ␊
 ␊
 ␊
 ␊
+··<script>␊
+····console.log("hello·world");␊
+··</script>␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
 </body>␊
 ␊
 ␊
 ␊

🔧 15

Using JS-Beautify beautifier:

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··<script>␊
····console.log("hello·world");␊
··</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "XML": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 15,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 15
===================================================================
--- 15  Original
+++ 15  Beautified
@@ -17,25 +17,13 @@
 ␊
 ␊
 ␊
 ␊
+··<script>␊
+····console.log("hello·world");␊
+··</script>␊
 ␊
 ␊
-␊
-␊
-␊
-␊
-␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
 </body>␊
 ␊
 ␊
 ␊

🔧 20

Using JS-Beautify beautifier:

<html>␊
␊
␊
␊
<body>␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
␊
··<script>␊
····console.log("hello·world");␊
··</script>␊
␊
␊
</body>␊
␊
␊
␊
</html>

How to configure A .unibeautify.json file would look like the following:

{
  "XML": {
    "indent_size": 2,
    "indent_char": " ",
    "max_preserve_newlines": 20,
    "beautifiers": [
      "JS-Beautify"
    ]
  }
}

Difference from original

Index: 20
===================================================================
--- 20  Original
+++ 20  Beautified
@@ -22,20 +22,13 @@
 ␊
 ␊
 ␊
 ␊
+··<script>␊
+····console.log("hello·world");␊
+··</script>␊
 ␊
 ␊
-␊
-<script>␊
-␊
-␊
-console.log("hello·world");␊
-␊
-␊
-</script>␊
-␊
-␊
 </body>␊
 ␊
 ␊
 ␊

Add XTemplate Example

No example found. Please submit a Pull Request!

← Keyword CaseMultiline Ternary →
  • Support
  • Examples
Unibeautify
Docs
Getting StartedCLIConfigurationOptions
Community
User ShowcaseStack Overflow@Unibeautify on TwitterFollow Unibeautify on Twitter
More
GitHubStar Unibeautify on GitHubCode coverage of UnibeautifyCode coverage of Unibeautify
© 2020 Glavin Wiechert
Credits