diff --git a/examples/simple-jsbeautifyrc/test.sass b/examples/simple-jsbeautifyrc/test.sass new file mode 100644 index 0000000..44e52bb --- /dev/null +++ b/examples/simple-jsbeautifyrc/test.sass @@ -0,0 +1,6 @@ +a { +line-height: 56px; +&:hover { + color: blue; +} +} diff --git a/lib/langs/less-beautify.js b/lib/langs/less-beautify.js index f4f9bce..d4ca05d 100644 --- a/lib/langs/less-beautify.js +++ b/lib/langs/less-beautify.js @@ -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]; diff --git a/lib/language-options.js b/lib/language-options.js index c6c2ee2..0d2e51d 100644 --- a/lib/language-options.js +++ b/lib/language-options.js @@ -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;