Comparing version 0.8.0 to 0.8.1
0.8.1 / 2011-03-04 | ||
================== | ||
* Added `pre` pipe-less text support (and auto-escaping) | ||
0.8.0 / 2011-03-04 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -156,2 +156,3 @@ | ||
if (tag.text) this.buffer(utils.text(tag.text[0].trimLeft())); | ||
this.escape = 'pre' == tag.name; | ||
this.visit(tag.block); | ||
@@ -187,3 +188,5 @@ this.buffer('</' + name + '>'); | ||
visitText: function(text){ | ||
this.buffer(utils.text(text.join('\\n'))); | ||
text = utils.text(text.join('\\n')); | ||
if (this.escape) text = escape(text); | ||
this.buffer(text); | ||
this.buffer('\\n'); | ||
@@ -309,1 +312,17 @@ }, | ||
}; | ||
/** | ||
* Escape the given string of `html`. | ||
* | ||
* @param {String} html | ||
* @return {String} | ||
* @api private | ||
*/ | ||
function escape(html){ | ||
return String(html) | ||
.replace(/&(?!\w+;)/g, '&') | ||
.replace(/</g, '<') | ||
.replace(/>/g, '>') | ||
.replace(/"/g, '"'); | ||
} |
@@ -20,3 +20,3 @@ | ||
exports.version = '0.8.0'; | ||
exports.version = '0.8.1'; | ||
@@ -23,0 +23,0 @@ /** |
@@ -33,3 +33,3 @@ | ||
var textOnly = exports.textOnly = ['script', 'textarea', 'style']; | ||
var textOnly = exports.textOnly = ['pre', 'script', 'textarea', 'style']; | ||
@@ -36,0 +36,0 @@ /** |
{ | ||
"name": "jade", | ||
"description": "Jade template engine", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -6,0 +6,0 @@ "main": "./index.js", |
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
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
65597
1738