Added ability to specify unescaped items with &.

This commit is contained in:
Alan Johnson
2010-08-08 16:34:19 -04:00
parent 8a1dd118af
commit d5d06c71f0
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -240,7 +240,7 @@ Handlebars.Compiler.prototype = {
} else if(next === "#") {
this.openBlock = true;
this.getChar();
} else if(next === "{") {
} else if(next === "{" || next === "&") {
this.escaped = false;
this.getChar();
}
+3
View File
@@ -32,6 +32,9 @@ test("escaping", function() {
shouldCompileTo("{{awesome}}", {awesome: "&\"\\<>"}, '&amp;\"\\\\&lt;&gt;',
"by default expressions should be escaped");
shouldCompileTo("{{&awesome}}", {awesome: "&\"\\<>"}, '&\"\\<>',
"expressions with {{& handlebars aren't escaped");
});
test("functions", function() {