Closes #44. Switch to using Pretty Diff for SASS, as well.

See #54. Use indent_size and indent_character options.
This commit is contained in:
Glavin Wiechert 2014-08-03 23:35:48 -04:00
parent 6b2a00602f
commit 1f0fb9c0db
3 changed files with 12 additions and 3 deletions

View File

@ -0,0 +1,6 @@
a {
line-height: 56px;
&:hover {
color: blue;
}
}

View File

@ -6,7 +6,9 @@ module.exports = function (text, options, callback) {
var args = {
source: text,
lang: 'css',
mode: 'beautify'
mode: 'beautify',
inchar: options.indent_character,
insize: options.indent_size
},
output = prettydiff.api(args);
var result = output[0];

View File

@ -15,6 +15,7 @@ var beautifyPHP = require('./langs/php-beautify');
var beautifyPython = require('./langs/python-beautify');
var beautifyRuby = require('./langs/ruby-beautify');
var beautifyLESS = require('./langs/less-beautify');
var beautifySASS = beautifyLESS;
var beautifyCoffeeScript = require('./langs/coffeescript-beautify');
// Misc
var Analytics = require('analytics-node');
@ -98,12 +99,12 @@ module.exports = {
text = beautifyHTML(text, self.getOptions('html', allOptions));
beautifyCompleted(text);
break;
case 'Sass':
case 'SCSS':
case 'CSS':
text = beautifyCSS(text, self.getOptions('css', allOptions));
beautifyCompleted(text);
break;
case 'Sass':
case 'SCSS':
case 'LESS':
beautifyLESS(text, self.getOptions('css', allOptions), beautifyCompleted);
break;