Skip to content

Commit

Permalink
Closes #44. Switch to using Pretty Diff for SASS, as well.
Browse files Browse the repository at this point in the history
See #54. Use indent_size and indent_character options.
  • Loading branch information
Glavin001 committed Aug 4, 2014
1 parent 6b2a006 commit 1f0fb9c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions examples/simple-jsbeautifyrc/test.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
a {
line-height: 56px;
&:hover {
color: blue;
}
}
4 changes: 3 additions & 1 deletion lib/langs/less-beautify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
5 changes: 3 additions & 2 deletions lib/language-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1f0fb9c

Please sign in to comment.