Comparing version 0.9.2 to 0.9.3
0.9.3 / 2011-03-24 | ||
================== | ||
* Added `Block#unshift(node)` | ||
* Added `jade.js` for the client-side to the repo | ||
* Added `jade.min.js` for the client-side to the repo | ||
* Removed need for pipes in filters. Closes #185 | ||
Note that this _will_ break filters used to | ||
manipulate the AST, until we have a different | ||
syntax for doing so. | ||
0.9.2 / 2011-03-23 | ||
@@ -3,0 +14,0 @@ ================== |
39
jade.js
@@ -518,3 +518,3 @@ | ||
exports.version = '0.8.9'; | ||
exports.version = '0.9.3'; | ||
@@ -1416,2 +1416,14 @@ /** | ||
/** | ||
* Unshift the given `node`. | ||
* | ||
* @param {Node} node | ||
* @return {Number} | ||
* @api public | ||
*/ | ||
Block.prototype.unshift = function(node){ | ||
return this.nodes.unshift(node); | ||
}; | ||
}); // module: nodes/block.js | ||
@@ -2029,3 +2041,3 @@ | ||
/** | ||
* filter attrs? (text | block) | ||
* filter attrs? text-block | ||
*/ | ||
@@ -2038,12 +2050,5 @@ | ||
if ('text' == tok.val) { | ||
this.lexer.textPipe = false; | ||
block = this.parseTextBlock(); | ||
this.lexer.textPipe = true; | ||
return block; | ||
} else if ('text' == this.lookahead(2).type) { | ||
block = this.parseTextBlock(); | ||
} else { | ||
block = this.parseBlock(); | ||
} | ||
this.lexer.textPipe = false; | ||
block = this.parseTextBlock(); | ||
this.lexer.textPipe = true; | ||
@@ -2083,3 +2088,3 @@ var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); | ||
text.push('\\n'); | ||
text.push(this.parseTextBlock().map(function(text){ | ||
text.push(this.parseTextBlock().nodes.map(function(text){ | ||
return ' ' + text; | ||
@@ -2173,8 +2178,2 @@ }).join('')); | ||
// Assume newline when tag followed by text | ||
if (this.peek().type === 'text') { | ||
if (tag.text) tag.text.push('\\n'); | ||
else tag.text = new nodes.Text('\\n'); | ||
} | ||
tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); | ||
@@ -2251,3 +2250,3 @@ | ||
var interpolate = exports.interpolate = function(str){ | ||
return str.replace(/(\\)?([#$!]){(.*?)}/g, function(str, escape, flag, code){ | ||
return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ | ||
return escape | ||
@@ -2254,0 +2253,0 @@ ? str |
@@ -22,3 +22,3 @@ | ||
exports.version = '0.9.2'; | ||
exports.version = '0.9.3'; | ||
@@ -25,0 +25,0 @@ /** |
@@ -43,1 +43,13 @@ | ||
}; | ||
/** | ||
* Unshift the given `node`. | ||
* | ||
* @param {Node} node | ||
* @return {Number} | ||
* @api public | ||
*/ | ||
Block.prototype.unshift = function(node){ | ||
return this.nodes.unshift(node); | ||
}; |
@@ -249,3 +249,3 @@ | ||
/** | ||
* filter attrs? (text | block) | ||
* filter attrs? text-block | ||
*/ | ||
@@ -258,12 +258,5 @@ | ||
if ('text' == tok.val) { | ||
this.lexer.textPipe = false; | ||
block = this.parseTextBlock(); | ||
this.lexer.textPipe = true; | ||
return block; | ||
} else if ('text' == this.lookahead(2).type) { | ||
block = this.parseTextBlock(); | ||
} else { | ||
block = this.parseBlock(); | ||
} | ||
this.lexer.textPipe = false; | ||
block = this.parseTextBlock(); | ||
this.lexer.textPipe = true; | ||
@@ -270,0 +263,0 @@ var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); |
{ | ||
"name": "jade", | ||
"description": "Jade template engine", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -6,0 +6,0 @@ "main": "./index.js", |
@@ -29,3 +29,2 @@ | ||
- :cdata | ||
- :text | ||
- :coffeescript must have [coffee-script](http://jashkenas.github.com/coffee-script/) installed | ||
@@ -187,15 +186,2 @@ - [Vim Syntax](https://github.com/digitaltoad/vim-jade) | ||
Alternatively if you decide no inline tags are needed, you may use the `:text` filter: | ||
html | ||
head | ||
title Example | ||
p | ||
:text | ||
You can place any text, | ||
that you like here | ||
even if it is indented really | ||
strange | ||
. | ||
Once again as an alternative, we may use a leading '.' to indicate a text block, for example: | ||
@@ -371,4 +357,4 @@ | ||
:markdown | ||
| Woah! jade _and_ markdown, very **cool** | ||
| we can even link to [stuff](http://google.com) | ||
Woah! jade _and_ markdown, very **cool** | ||
we can even link to [stuff](http://google.com) | ||
@@ -379,3 +365,3 @@ Renders: | ||
Filters may also now manipulate the parse tree. For example perhaps I want to | ||
Filters may also manipulate the parse tree. For example perhaps I want to | ||
bake conditionals right into jade, we could do so with a filter named _conditionals_. Typically filters work on text blocks, however by passing a regular block our filter can do anything it wants with the tags nested within it. | ||
@@ -382,0 +368,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143223
42
3734
3
507
10
12