Unescape Strings
Config Key: unescape_strings
Description: Decode printable characters encoded in xNN notation
Available since version: 0.7.0 (Current: )
Type: boolean
Default: false
Support
Languages: EJS, JSX, JavaScript
Beautifiers: JS-Beautify
Comparison Table
Language | JS-Beautify |
---|---|
EJS | ✅ |
JSX | ✅ |
JavaScript | ✅ |
Examples
Carriage Return = ␍; Line Feed = ␊; Tab = ⇥; Whitespace = ·.
🚧 Original Code
example␊
\x65\x78\x61\x6d\x70\x6c\x65␊
\x74\x68\x69\x73␊
🔧 true
Using JS-Beautify beautifier:
example\·x65\·x78\·x61\·x6d\·x70\·x6c\·x65\·x74\·x68\·x69\·x73
How to configure
A .unibeautify.json
file would look like the following:
{
"JSX": {
"indent_size": 2,
"indent_char": " ",
"unescape_strings": true,
"beautifiers": [
"JS-Beautify"
]
}
}
Difference from original
Index: true
===================================================================
--- true Original
+++ true Beautified
@@ -1,3 +1,1 @@
-example␊
-\x65\x78\x61\x6d\x70\x6c\x65␊
-\x74\x68\x69\x73␊
+example\·x65\·x78\·x61\·x6d\·x70\·x6c\·x65\·x74\·x68\·x69\·x73
\ No newline at end of file
🔧 false
Using JS-Beautify beautifier:
example\·x65\·x78\·x61\·x6d\·x70\·x6c\·x65\·x74\·x68\·x69\·x73
How to configure
A .unibeautify.json
file would look like the following:
{
"JSX": {
"indent_size": 2,
"indent_char": " ",
"unescape_strings": false,
"beautifiers": [
"JS-Beautify"
]
}
}
Difference from original
Index: false
===================================================================
--- false Original
+++ false Beautified
@@ -1,3 +1,1 @@
-example␊
-\x65\x78\x61\x6d\x70\x6c\x65␊
-\x74\x68\x69\x73␊
+example\·x65\·x78\·x61\·x6d\·x70\·x6c\·x65\·x74\·x68\·x69\·x73
\ No newline at end of file