Merge pull request #191 from Akhrameev/akhrameev/doubled_spaces_fix

doubled spaces fix
This commit is contained in:
Ivan Mathy 2021-03-15 21:23:18 -05:00 committed by GitHub
commit adcd6ce894
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -11,7 +11,7 @@
function main(input) {
let lines = input.text.split('\n')
let out = unique(lines)
let out = unique(lines)
input.text = out.join('\n')

View File

@ -121,7 +121,7 @@
}
}
return (str.charAt(0) === '\n') ? str.slice(1) : str;
return (str.charAt(0) === '\n') ? str.slice(1) : str;
};
vkbeautify.prototype.css = function(text, step) {
@ -142,13 +142,13 @@
for(ix=0;ix<len;ix++) {
if( /{/.exec(ar[ix])) {
if( /{/.exec(ar[ix])) {
str += shift[deep++]+ar[ix];
} else
if( /}/.exec(ar[ix])) {
if( /}/.exec(ar[ix])) {
str += shift[--deep]+ar[ix];
} else
if( /\*\\/.exec(ar[ix])) {
if( /\*\\/.exec(ar[ix])) {
str += shift[deep]+ar[ix];
}
else {
@ -246,25 +246,25 @@
parenthesisLevel = isSubquery(ar[ix], parenthesisLevel);
if( /\s*\s*SELECT\s*/.exec(ar[ix])) {
if( /\s*\s*SELECT\s*/.exec(ar[ix])) {
ar[ix] = ar[ix].replace(/,/g,",\n"+tab+tab+"");
}
if( /\s*\s*SET\s*/.exec(ar[ix])) {
if( /\s*\s*SET\s*/.exec(ar[ix])) {
ar[ix] = ar[ix].replace(/,/g,",\n"+tab+tab+"");
}
if( /\s*\(\s*SELECT\s*/.exec(ar[ix])) {
if( /\s*\(\s*SELECT\s*/.exec(ar[ix])) {
deep++;
str += shift[deep]+ar[ix];
} else
if( /'/.exec(ar[ix]) ) {
if( /'/.exec(ar[ix]) ) {
if(parenthesisLevel<1 && deep) {
deep--;
}
str += ar[ix];
}
else {
else {
str += shift[deep]+ar[ix];
if(parenthesisLevel<1 && deep) {
deep--;
@ -307,4 +307,4 @@
})();