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 = { var args = {
source: text, source: text,
lang: 'css', lang: 'css',
mode: 'beautify' mode: 'beautify',
inchar: options.indent_character,
insize: options.indent_size
}, },
output = prettydiff.api(args); output = prettydiff.api(args);
var result = output[0]; var result = output[0];

View File

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