Permalink
Browse files

Release 0.21.0

  • Loading branch information...
1 parent fbd0504 commit a749b8196b767fd6770e3f02f059ea934e52ac3e @tj tj committed Mar 10, 2012
Showing with 33 additions and 22 deletions.
  1. +8 −0 History.md
  2. +21 −18 jade.js
  3. +2 −2 jade.min.js
  4. +1 −1 lib/jade.js
  5. +1 −1 package.json
View
@@ -1,4 +1,12 @@
+0.21.0 / 2012-03-10
+==================
+
+ * Added new input/output test suite using Mocha's string diffing
+ * Added alias `extend` -> `extends`. Closes #527 [guillermo]
+ * Fixed include escapes. Closes #513
+ * Fixed block-expansion with .foo and #foo short-hands. Closes #498
+
0.20.3 / 2012-02-16
==================
View
39 jade.js
@@ -30,7 +30,7 @@ require.register = function (path, fn){
require.relative = function (parent) {
return function(p){
- if ('.' != p[0]) return require(p);
+ if ('.' != p.charAt(0)) return require(p);
var path = parent.split('/')
, segs = p.split('/');
@@ -120,7 +120,7 @@ Compiler.prototype = {
compile: function(){
this.buf = ['var interp;'];
- this.lastBufferedIdx = -1
+ this.lastBufferedIdx = -1;
this.visit(this.node);
return this.buf.join('\n');
},
@@ -380,6 +380,8 @@ Compiler.prototype = {
this.buf.push(fn(filter.block, this, filter.attrs));
} else {
var text = filter.block.nodes.join('');
+ filter.attrs = filter.attrs || {};
+ filter.attrs.filename = this.options.filename;
this.buffer(utils.text(fn(text, filter.attrs)));
}
},
@@ -719,7 +721,7 @@ var Parser = require('./parser')
* Library version.
*/
-exports.version = '0.20.1';
+exports.version = '0.21.0';
/**
* Expose self closing tags.
@@ -1061,9 +1063,9 @@ Lexer.prototype = {
, nend = 0
, pos = 0;
for (var i = 0, len = str.length; i < len; ++i) {
- if (start == str[i]) {
+ if (start == str.charAt(i)) {
++nstart;
- } else if (end == str[i]) {
+ } else if (end == str.charAt(i)) {
if (++nend == nstart) {
pos = i;
break;
@@ -1184,8 +1186,8 @@ Lexer.prototype = {
* Extends.
*/
- extends: function() {
- return this.scan(/^extends +([^\n]+)/, 'extends');
+ "extends": function() {
+ return this.scan(/^extends? +([^\n]+)/, 'extends');
},
/**
@@ -1256,7 +1258,7 @@ Lexer.prototype = {
* Case.
*/
- case: function() {
+ "case": function() {
return this.scan(/^case +([^\n]+)/, 'case');
},
@@ -1272,7 +1274,7 @@ Lexer.prototype = {
* Default.
*/
- default: function() {
+ "default": function() {
return this.scan(/^default */, 'default');
},
@@ -1330,7 +1332,7 @@ Lexer.prototype = {
* While.
*/
- while: function() {
+ "while": function() {
var captures;
if (captures = /^while +([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
@@ -1375,7 +1377,7 @@ Lexer.prototype = {
*/
attrs: function() {
- if ('(' == this.input[0]) {
+ if ('(' == this.input.charAt(0)) {
var index = this.indexOfDelimiters('(', ')')
, str = this.input.substr(1, index-1)
, tok = this.tok('attrs')
@@ -1501,7 +1503,7 @@ Lexer.prototype = {
}
for (var i = 0; i < len; ++i) {
- parse(str[i]);
+ parse(str.charAt(i));
}
parse(',');
@@ -1620,18 +1622,18 @@ Lexer.prototype = {
|| this.pipelessText()
|| this.yield()
|| this.doctype()
- || this.case()
+ || this["case"]()
|| this.when()
- || this.default()
- || this.extends()
+ || this["default"]()
+ || this["extends"]()
|| this.append()
|| this.prepend()
|| this.block()
|| this.include()
|| this.mixin()
|| this.conditional()
|| this.each()
- || this.while()
+ || this["while"]()
|| this.assignment()
|| this.tag()
|| this.filter()
@@ -2081,7 +2083,8 @@ var Node = require('./node');
var Literal = module.exports = function Literal(str) {
this.str = str
- .replace(/\n/g, "\\n")
+ .replace(/\\/g, "\\\\")
+ .replace(/\n|\r\n/g, "\\n")
.replace(/'/g, "\\'");
};
@@ -2900,7 +2903,7 @@ Parser.prototype = {
case ':':
this.advance();
tag.block = new nodes.Block;
- tag.block.push(this.parseTag());
+ tag.block.push(this.parseExpr());
break;
}
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -20,7 +20,7 @@ var Parser = require('./parser')
* Library version.
*/
-exports.version = '0.20.3';
+exports.version = '0.21.0';
/**
* Expose self closing tags.
View
@@ -1,7 +1,7 @@
{
"name": "jade",
"description": "Jade template engine",
- "version": "0.20.3",
+ "version": "0.21.0",
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"repository": "git://github.com/visionmedia/jade",
"main": "./index.js",

0 comments on commit a749b81

Please sign in to comment.