Skip to content

Commit

Permalink
Removed pretty option
Browse files Browse the repository at this point in the history
was lame anyway
  • Loading branch information
tj committed Oct 5, 2010
1 parent 970a48f commit e0ef654
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
1 change: 0 additions & 1 deletion examples/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
var jade = require('./../lib/jade');

var options = {
pretty: true,
locals: {
user: {
name: 'TJ',
Expand Down
1 change: 0 additions & 1 deletion examples/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var jade = require('./../lib/jade'),
nodes = jade.nodes;

var options = {
pretty: true,
locals: {
user: {
name: 'Tobi',
Expand Down
22 changes: 3 additions & 19 deletions lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ var nodes = require('./nodes'),
/**
* Initialize `Compiler` with the given `node`.
*
* Options:
*
* - `pretty` prettyify output with proper indentation
*
* @param {Node} node
* @param {Object} options
* @api public
Expand All @@ -30,8 +26,6 @@ var nodes = require('./nodes'),
var Compiler = module.exports = function Compiler(node, options) {
this.options = options = options || {};
this.node = node;
this.pretty = options.pretty;
this.indents = options.indents || 0;
};

/**
Expand Down Expand Up @@ -109,11 +103,9 @@ Compiler.prototype = {
*/

visitBlock: function(block){
++this.indents;
for (var i = 0, len = block.length; i < len; ++i) {
this.visit(block[i]);
}
--this.indents;
},

/**
Expand Down Expand Up @@ -144,28 +136,20 @@ Compiler.prototype = {
visitTag: function(tag){
var name = tag.name;

// Indentation
var indents = this.pretty
? Array(this.indents).join(' ')
: '';

// Newline
var nl = this.pretty ? '\\n' : '';

if (~selfClosing.indexOf(name)) {
this.buffer(nl + indents + '<' + name);
this.buffer('<' + name);
this.visitAttributes(tag.attrs);
this.terse
? this.buffer('>')
: this.buffer('/>');
} else {
// Optimize attributes buffering
if (tag.attrs.length) {
this.buffer(nl + indents + '<' + name);
this.buffer('<' + name);
if (tag.attrs.length) this.visitAttributes(tag.attrs);
this.buffer('>');
} else {
this.buffer(nl + indents + '<' + name + '>');
this.buffer('<' + name + '>');
}
if (tag.code) this.visitCode(tag.code);
if (tag.text) this.buffer(utils.text(tag.text));
Expand Down

0 comments on commit e0ef654

Please sign in to comment.